It's easy to "disable" NSLog
at compile time by replacing it with a macro, etc.
Can NSLog
(or ASL in general) be disabled at runtime?
My goal is to silence some logs that I do not have control over.
It's easy to "disable" NSLog
at compile time by replacing it with a macro, etc.
Can NSLog
(or ASL in general) be disabled at runtime?
My goal is to silence some logs that I do not have control over.
Look at the Lumberjack Framework. There you can set the logging level as required. To hide certain log statements when you release the app, just change the logging level from say DEBUG to INFO using #ifdef RELEASE and #ifdef DEBUG macros.
Update:
In case the log statements are coming from a different framework that you are linking, you can use something like Method Swizzling to swap the implementation of NSlog with your custom method.