[ 
https://issues.apache.org/jira/browse/CB-4739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14244159#comment-14244159
 ] 

Ivan Karpan commented on CB-4739:
---------------------------------

What I did is added the following code to the *-Prefix.pch:
#ifdef DEBUG
#   define NSLog(...) NSLog(__VA_ARGS__)
#else
#   define NSLog(...)
#endif

And in the build settings of my project/target I added the following 
Preprocessor Macros to configurations you want your logs to be visible in:
DEBUG=1

Both of the above could be added to Cordova iOS template but in this case I 
would go for another function (DLog) not to mess with the developer's 
expectation of NSLog always outputing to the console unless managed manually. 
This would mean all of the Cordova iOS code will have to use DLog, which is 
actually an easy search and replace (that will have to be done in all of the 
different repos though).

We could go further with this. Similarly to target device configuration this is 
the build settings. If we have a way to affect this on Cordova prepare logs 
could be controller via config.xml.

> Add ability to suppress logs (NSLog)
> ------------------------------------
>
>                 Key: CB-4739
>                 URL: https://issues.apache.org/jira/browse/CB-4739
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: iOS
>    Affects Versions: Master
>            Reporter: Shazron Abdullah
>            Priority: Minor
>
> Right now the core Cordova code has some NSLogs. We could "wrap" them to 
> control output visibility but this does not solve use of NSLogs by plugins. 
> Not sure of an easy way to support this globally.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to