Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable NSLog all over the app?

I want to disable NSLog() across all instances in an app. I found some code that does that:

#ifndef DEBUG
#define NSLog //
#endif

But adding this code to each file isn't good idea. How can I make it easier?

like image 593
Timur Bernikovich Avatar asked Apr 14 '13 17:04

Timur Bernikovich


1 Answers

Xcode has a precompiled header file ({project-name}-Prefix.pch in the Supporting Files group by default) that is a great place to put code that will be used across every file in the project. For going a step further and improving the log message itself, see Is it true that one should not use NSLog() on production code?.

like image 196
jszumski Avatar answered Oct 01 '22 06:10

jszumski