Tired of NSLog? There’s another way.

Have you ever been tired of finding where the log come from in Xcode?

Have you ever been tired of hiding all log from user?

Yes, i know. Using NSLog is an easy way to show everything you need to device’s console. But sometime it’s difficult to find what the messages in console mean, where they come from.

After some searches on StackOverFlow, i found a solution.

Forget about NSLog, use LBLog (or XXLog, whatever you like), then in console, you will see the file, the line where it comes from.

How to use LBLog? Just the same way as NSLog.

Done? No, your app’s users could see everything you log. Dont want them to see in RELEASE mode?

Done! Now only you could see what you want, in DEBUG mode.

Source: http://stackoverflow.com/questions/2770307/nslog-the-method-name-with-objective-c-in-iphone

Bang Nguyen

Small things make big things.