CocoaLumberjack - how to access the log file on the device? - iphone

I am using CocoaLumberjack for my logging as it seems a very versatile logging framework.
In my application, I need to log to a file, and have the contents of that file displayed in the app itself: this is for diagnostics purposes for the user of the app (mainly so they can see how much the app is accessing their network, which I log to file).
There is the DDFileLogger and DDLogFileManager classes. I can see how I can use the DDLogFileManager class to access a file once it's wrapped, but what I want to do is display the contents of the file in a UITextView - so that it shows the current contents.. not just when it's wrapped.
Either way, I can't see how to access the log file within the app itself - can anyone shed some light on how to do this please?
thanks!

See my answer here:
https://stackoverflow.com/a/11544657/620577
And these characters are just to reach the 30 minimum.

Related

Read log file from Google DriveFS

I would like to find the reason for a bug with an application and the Google Drive on Mac. With FSMonitor, I see that drive writes many logs in a structured_log_* file at ~/Library/Application Support/Google/DriveFS/Logs/ when I have the issue. But when I open the file it's not really readable in editor and toolbox.googleapps.com/apps/loggershark need drive_fs*.txt file and it does not contain any related log.
I see that structured_log_* are logs related to the file I open fichier test dsi2, but it is not readable.
How can I decode and read the file ?
Did you ever find an answer?
I'm looking to view the structured_log_* logs to see if it contains information on files uploaded and removed from a google drive account. Basically for auditing proposes...
But unfortunately, I can't make anything out. I have passed it through strings and sorted and it looks like the file names are contained within these logs and possibly the hashes of the files.
It would be nice to be able to decode the log properly to see whats the activity on in the log.
Thanks

Flutter: Reading and Writing User Visible Files

I am looking for something along the lines of getExternalStorageDirectory that is available in both iOS and android. The purpose of this directory is to save and retrieve .json configuration files that would be later read back by the application. However the normal getApplicationDocumentsDirectory isn't really what I need. The user is likely to want direct access to the saved files to send them to friends, forums, etc.
Workflows might include:
User A emails a config to User B
User uploads a configuration to a forum
User downloads a configuration from a forum
User creates a configuration offline using a json editor
It seems like I must be missing something obvious here as this seems like a common requirement but I have not found a suitable way to do this.
Thanks
Assuming we're speaking of the path_provider plugin, it actually contains a function called getExternalStorageDirectory, though, as the documentation states, iOS prohibits the user from arbitrarily accessing any directory on the device. I would suggest checking for the platform. If on Android, use getExternalStorageDirectory for Android, and if on iOS, use getApplicationDocumentsDirectory and make it visible to the user. More on that here: How to save a text file in external storage in ios using flutter?
Can't think of any other way of achieving this, since iOS is very strict when it comes to file management (or anything else, really).

RStudio CentOS server log messages

I'm using R/RStudio on CentOS platform. I need to see if the binary log file (/var/log/messages) contains further information regarding a graphics device plotting issue, but I cannot read it from within RStudio.
I cannot find any information on the community support troubleshooting pages. The Help Menu -> Diagnostics -> ... does not indicate a 'Show Log Files' option. Can someone advise how this file can be accessed, preferably from within RStudio?
By default /var/log/messages is not readable by all users, so the first thing you need to do is make it accessible to whatever user you're logged in as in RStudio. This question has details and ideas:
https://serverfault.com/questions/258827/what-is-the-most-secure-way-to-allow-a-user-read-access-to-a-log-file
Once your user account has permissions to /var/log/messages, you can use something like the following to show it in RStudio:
> readLines("/var/log/messages")
(You could also try file.edit("/var/log/messages") to open it in an editor buffer, but that is less likely to succeed.)

iPhone MoveMe Example - trouble with DisplayStrings

I'm starting to play a bit with iPhone applications and I downloaded the MoveMe example from the apple web page.
I managed to run the app, however I do not get the strings displayed. I noticed that the DisplayStrings.strings file, although it exists in the app folder, does not appear as one of the resources.
I tried adding it as a resource, but then after compiling I get an error saying "copystrings failed with exit code 1". I cannot find anything online regarding what the origin of this problem is...
The file itself is in utf16 (big endian), and contains simply a list of strings separated by new lines.
Any ideas?
Thanks.
I was having the same problem and as a workaround I renamed DisplayStrings.strings to DisplayStrings.data and added it as a resource. I then modified init in PlacardView.m to use the new filename. This made Xcode happy.
I fixed this by adding the DisplayStrings.strings file as a resource. However, when you do this it defaults the type to 'text.plist.strings' which is incorrect, since the file is just text. So, right click on the DisplayStrings.strings file in resources and change the type to 'text'. This solved the problem for me.

Launch my app using email attachement

I want to bind my app to some file extension so when I receive an email with an attached file with the correct extension, clicking on it will launch my app and pass it the attached file.
Is it possible ? How ?
Thx
--G.
As iPhone applications are not allowed to share files on the file system, what you're looking for is not immediately possible (not with the published APIs that I know of, anyway). You might still have a couple of options though.
Either way you'll have to use a custom URL scheme, which is associated with your app, and paste that into your email. This URL might point to some external location, which your app can download the file from.
Or it might contain the actual file contents if it's fairly small. URLs are 'just text' (some restrictions apply), so you're free to put any data you want to in it, as long as it is URL-encoded.
You still need to get the URL into the email though, which might or might not be as easy as attaching a file.
It's not possible to simply associate a file extension with an application on the iPhone.
You could create a custom URL scheme that would launch your app, but probably that won't help you.
This is actually possible, I'm working on this exact same problem and this great tutorial has really helped me.