0

Possible Duplicate:
Do I need to disable NSLog before release Application?

In my iPhone app there are more than 20 classes.Every where I am printing so many values using NSLog.When I run my app on simulator it is bit low because of some NSLogs(specially printing NSData etc)

Will it be slow if I finished the app and run it on device after making the ipa file ? Or should I comment all the NSLogs from classes ?

Community
  • 1
  • 1

3 Answers3

5

yes it does. and if u wanna check it by urself, do profiling with allocations, and see what is taking much of your memory. It will show NSLogs also.

Nikita P
  • 4,226
  • 5
  • 31
  • 55
1

instead of NSLog use DLog everywhere. When testing and debugging, you'll get debug messages. When you're ready to release a beta or final release, all those DLog lines automatically become empty and nothing gets emitted. This way there's no manual setting of variables or commenting of NSLogs required. Picking your build target takes care of it.

ThePunisher
  • 410
  • 1
  • 4
  • 14
0

NSLog will affect speed as it blocks and causes IO. It runs synchronously in the current thread. better is something async! -- like cocoalumberjack's DDLog which is a drop in replacement that doesnt block. [still can cause IO, see next info about levels]


ALSO DDLog knows about log levels. E.G. info, Warning & Error: in release mode you set it to error by default (but it can be changed via a UserDefault value!)

warnings and infos are not logged then which makes it cause only VERY little overhead


DDLog is similar to log4j but for objC!

Daij-Djan
  • 49,552
  • 17
  • 113
  • 135