I\'m using CocoaLumberjack in an iPhone project, to log some information.
I\'ve followed the Getting started guide, and everything works fine, but there is one thing
I didn't find a better way to do it than the one explained in the article I mentioned in the question.
Constant.h
extern int const ddLogLevel;
Constant.m
#import "Constants.h"
#import "DDLog.h"
int const ddLogLevel = LOG_LEVEL_VERBOSE;
Logger configuration
#import "DDLog.h"
#import "DDASLLogger.h"
#import "DDTTYLogger.h"
#import "DDFileLogger.h"
...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[DDLog addLogger:[DDASLLogger sharedInstance]];
[DDLog addLogger:[DDTTYLogger sharedInstance]];
DDFileLogger *fileLogger = [[DDFileLogger alloc] init];
[DDLog addLogger:fileLogger];
[fileLogger release];
...
Import your class
#import "DDLog.h"
#import "Constants.h"
...
- (void)someMethod {
DDLogVerbose(@"Log this message");
}