as a Dev, I can offer these two methods, although I agree with Daniel, that Stack Overflow is a better place to ask this.
Anyway, the first is a simple replace.
Shift-Option-f. Then type NSLog. That will find all the occurances of NSLog in your app.
Then switch find to replace. Then replace "NSLog" with "//NSLog". That will comment out all of them.
A second - better option takes a bit more work.
First, do the above but instead of replacing the string with "//NSLog", replace it with something like "DLog".
Then, in the prefix.pch file.. Write something like this:
#ifdef DEBUG
# define DLog(...) NSLog(__VA_ARGS__)
#else
# define DLog(...)
#endif
#define ALog(...) NSLog(__VA_ARGS__)
This way, while your app is in debug mode, all the logs will appear, but when you move your app to release mode, the logs are hidden.
Hope this helps.
System logs, for example, are compressed and then automatically deleted after a week. However, System Diagnostic Reports (whether it be a stall, spin, hang, crash, or panic report) shouldn't be automatically deleted. If you reset the NVRAM immediately following a kernel panic, however, the report is deleted (the NVRAM temporarily stores the report until reboot; if it's reset, the contents are erased). Short of forcibly removing the files (using Onyx, a similar app, or manually), this is the only situation I can come up with off hand as to why a report would vanish.
As a makeshift solution, however, you can save the kernel panic reports as a separate file.
- From Console's menu bar, View > Show Log List
- Select the panic report (kernel_[longstring].panic) from the "System Diagnostic Reports" drop down
- File > Save a Copy As... > save file to folder of your choice
UPDATE:
Onyx is the most likely culprit, however, the option for clearing logs/reports is located in multiple places:
- Cleaning > Logs > System Diagnostic Reports
- Automation > Cleaning > Logs, including Diagnostic Reports
Uncheck these options if they are checked.
Best Answer
You can redirect all logs to a file so that you can see it when needed. So you can resolve any issues come in future.
From https://stackoverflow.com/questions/18756592/how-to-get-old-console-log