0

NSLog(@"example");

will ouput :

2012-09-13 04:54:48.128 MyApp[94652:a0f]: example

on the console.

Is there a way I can get it to only output:

example

Norton Commander
  • 653
  • 1
  • 10
  • 21
  • possible duplicate of [Clean NSLog - No timestamp and program name](http://stackoverflow.com/q/7517252/), [Is there any way to disable the timestamps from NSLog()?](http://stackoverflow.com/q/1354728/), [How to get rid of all this garbage from NSLog()?](http://stackoverflow.com/q/1374926/), [Is it possible to NSLog() without the time, date, and newline?](http://stackoverflow.com/q/3487226/), [Customize NSLog() so it shows less info](http://stackoverflow.com/q/5673659/), [Disable the dates in the Xcode debugger?](http://stackoverflow.com/q/11810907/) – jscs Sep 14 '12 at 06:19

1 Answers1

5

If you define this macro and use it instead of NSLog it will only output what you specify.

#define NSLog(FORMAT, ...) printf("%s\n", [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
brynbodayle
  • 6,546
  • 2
  • 33
  • 49