I have a lot of calls to NSLog(...). I need to change all of these calls to CLSNSLog(...).

So I added this to my precompiled header (.pch):

#import <CrashlyticsFramework/Crashlytics.h>
#define NSLog(...) CLSNSLog(__VA_ARGS__);

Everything works. I don't see any drawbacks to this -- the team can continue to use NSLog(...) and I can revert pretty easily.

But am I missing anything, or are there any design issues this will create later on?


The only issue I can see is that it may be confusing. NSLog is a commonly used function provided by Foundation framework. But you change it globally to something else and new developer may not aware of it.

Other than that, it should be fine since the header/define won't change often.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.