rokridi
rokridi

Reputation: 1675

iOS enabling custom logger in release mode

In a recent application, i have been asked to enable debug logging when releasing builds so the testers can send us the log when testing the application. I have created a custom logger which depends on #IF DEBUG macro to enable or disable custom logging. This works fine on debug mode. But when i build a new release (with Bamboo) the testers could not see the custom log anymore. How can i enable my custom logging in release mode (via gcc_preprocessor_macros)? Should i rely on other preprocessor macros and ignore the DEBUG directive ?

Upvotes: 0

Views: 402

Answers (1)

Ian MacDonald
Ian MacDonald

Reputation: 14020

If you are in release mode, RELEASE is defined. If you are in debug mode, DEBUG is defined. If you want your custom logging available in release mode, you shouldn't use DEBUG as your condition.

If your goal is not to send a release build to your testers, but to send a "looks like release" build to testers, I suggest duplicating the release configuration and defining a PRETEND_RELEASE in it. See Your Project -> Info tab -> Configurations.

Upvotes: 1

Related Questions