-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conflicting definitions with CocoaLumberjack (using Carthage) #531
Comments
Hello, thanks for your feedback, can you try this:
|
This approach does not work for me. I have my |
Temporary workaround: Remove If you need to set the [NSClassFromString(@"MQTTLog") performSelector:@selector(setLogLevel:) withObject:@(ddLogLevel)]; |
@jcavar Your suggestion doesn't work. That does enable logging, but it isn't using CocoaLumberjack. I verified by setting breakpoints that it's just using MQTT's shim macros and never hitting any DDLog method. |
thx |
Short description
I can't get this to work with an app that is already using CocoaLumberjack 3.5.3 via Carthage because it causes conflicting definitions.
I set up my logging like this in
Logging.h
Then in my view controller
That
DDLogError
gives me two errors:extern DDLogLevel ddLogLevel;
from MQTTLog.h#define DDLogError if (ddLogLevel & DDLogFlagError) NSLog
If I remove the
@import MQTTClient;
it builds and logging works. If I remove the#import "Logging.h"
it also builds, but I can see that it isn't using CocoaLumberjack because it no longer respects my logging level.Environment
Steps to reproduce
@import MQTTClient;
Expected behaviour
There should be some way to import CocoaLumberjack and MQTTClient via Carthage and have MQTTClient use my CocoaLumberjack config.
Actual behaviour
Currently I can only find a way to use one or the other, not both.
Other information
I see that there's a
#ifdef LUMBERJACK
in MQTTLog.h. I tried adding#define LUMBERJACK
before I import MQTTClient, but it makes no difference. What does work is if I actually delete the contents of MQTTLog.h, then it builds fine.Also, not sure if related, even when I import MQTTClient on its own, I can't get it to log anything. For example, I see that it's supposed to log an error if I try to open an base MQTTTransport instance, but I don't see those logs appearing.
The text was updated successfully, but these errors were encountered: