0

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?

2

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 acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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