Search code examples
iphoneobjective-cxcodenslog

How to get rid of the date and time that appears before every NSLog statement in the console


I use NSLog in my application. And I'd like to get rid of the annoying beginning of each string: "2009-07-01 21:11:06.508 MyApp[1191:207]".

Is there a way to do so? Probably another logging function?

Thanks.


Solution

  • Read these:

    It's a Github project called "QuietLog", originally from our CocoaHeads site, that explains how to create a QuietLog function that does what you're describing. It also shows how to wrap QuietLog into a macro called LocationLog so that it'll print out the file name and line number where you've got the log statement. I use it in all of my projects, and I don't lose stray "NSLog" statements anymore.