Skip to content

Instantly share code, notes, and snippets.

@marcin-maciukiewicz
Created July 19, 2011 11:04
Show Gist options
  • Save marcin-maciukiewicz/1091990 to your computer and use it in GitHub Desktop.
Save marcin-maciukiewicz/1091990 to your computer and use it in GitHub Desktop.
Minimal Log4Cocoa stup
// log every category
[[L4Logger rootLogger] setLevel:[L4Level all]];
// send log messages to console
L4ConsoleAppender *consoleAppender=[[[L4ConsoleAppender alloc] initTarget:YES withLayout: [L4Layout simpleLayout]] autorelease];
[[L4Logger rootLogger] addAppender: consoleAppender];
L4Logger *theLogger = [L4Logger loggerForClass:[L4FunctionLogger class]];
[theLogger setLevel:[L4Level debug]];
//
log4Info(@"The logging system has been initialized.");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment