Search code examples
iosnslog

Remove NSLog header


Below is a typical NSLog output from the console. Can I get rid of the bold text?

2013-06-09 22:17:02.351 ProjectName[33584:907] MyWantedText

I want to cut out the console text, and compare it (by diff), to a similar log. I don't want time data etc that only will produce false positives.

Is it possible to make my own console write method, MyNsLog, if I can't alter de behavior NSLog?


Solution

  • for your app put this into your Prefix header:

    #undef NSLog
    #define NSLog(fmt, ...) printf("%s", [[NSString stringWithFormat:fmt, ##__VA_ARGS__] UTF8String])
    

    but id actually rather leave nslog and just use another logging mechanism like ddlog or so