I am trying to integrate CocoaLumberjack into an existing project (so that I can better register with a client machine that reports an error that I cannot duplicate). I successfully built a sample project and made it work in this, but it does nothing in my own application.
I copied the Lumberjack directory to my project directory and added it to the project. I added the following to the Prefix.pch file:
#import "DDLog.h"
#import "DDASLLogger.h"
#import "DDTTYLogger.h"
#import "DDFileLogger.h"
static const int ddLogLevel = LOG_LEVEL_VERBOSE;
I posted the following in -applicationDidFinishLaunching:
[DDLog addLogger:[DDASLLogger sharedInstance]]
[DDLog addLogger:[DDTTYLogger sharedInstance]]
Finally, I have the following in -awakeFromNib
NSLog(@"%@", @(ddLogLevel));
NSLog(@"%@", @(LOG_LEVEL_VERBOSE));
NSLog(@"%@", @"About to DDLog");
DDLogError(@"This is an error.");
DDLogWarn(@"This is a warning.");
DDLogInfo(@"This is just a message.");
DDLogVerbose(@"This is a verbose message.");
NSLog(@"%@", @"Done with DDLog");
The console shows:
2014-05-26 14:57:13.530 [21943:303] 31
2014-05-26 14:57:13.530 [21943:303] 31
2014-05-26 14:57:13.530 [21943:303] About to DDLog
2014-05-26 14:57:13.531 [21943:303] Done with DDLog
I tried to go through the source code of the library, but it is honestly above my head. Any help in figuring out what I'm doing wrong would be greatly appreciated.
Chuck