The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

Define Debug .vs. use __OPTIMIZE__ predefined macro in JMC iOS SDK

Martha Castillo
January 8, 2012

Hi.

After embedding JMC in my iPhone app, I noticed I couldn't see any log send from JMC.After a while , I realized I had not defined the Debug flag.

So , what 's the reason to define in JMCMacros

# ifdef DEBUG

# define JMCDLog(format, ...) JMCALog(format, ##__VA_ARGS__);

# else

# define JMCDLog(...)

# endif

instead of

#ifndef __OPTIMIZE__

# define JMCDLog(format, ...) JMCALog(format, ##__VA_ARGS__);

# else

# define JMCDLog(...)

# endif

?
By using predefined macro __OPTIMIZE__ ,you don't have to be worried or to know about to define an additional flag in your main project settings when embed the JMC SDK within your iOS app.
Cheers,

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
Nick
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 8, 2012

Hi Martha,

Xcode adds the DEBUG flag by default to your project settings for the Debug build configuration.

This is not added for the Release configuration. This means that when your app is build using the Release configuration, JMC log statements wont appear when run on the device.

Whilst this may not be the case for all projects, the reason we chose this approach was that we figured it is actually better to have no logging, than to have logging. For example, the api-key could potentially get leaked to the user if logs are accidently turned on and a URL is logged.

Cheers,

Nick

Martha Castillo
January 8, 2012

Hi, Nick.

Thanks for your reply.


I found that my project had the DEBUG flag lost in the "twilight zone", because it was created with Xcode 3.2.x some time ago; the default compiler for that Xcode versions used to be GCC, and DEBUG is not a defined macro in GCC.
Instead, the default compiler for Xcode 4.x is LLVM, and DEBUG is a defined macro in LLVM; so when you create a new project with Xcode 4.x, it adds the DEBUG flag by default to the project settings for the Debug build configuration, as you said.


Cheers,

MC

TAGS
AUG Leaders

Atlassian Community Events