CustomFormattersAppDelegate.m 991 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // CustomFormattersAppDelegate.m
  3. // CustomFormatters
  4. //
  5. // CocoaLumberjack Demos
  6. //
  7. #import "CustomFormattersAppDelegate.h"
  8. #import <CocoaLumberjack/CocoaLumberjack.h>
  9. #import "TestFormatter.h"
  10. // Debug levels: off, error, warn, info, verbose
  11. static const DDLogLevel ddLogLevel = DDLogLevelVerbose;
  12. @implementation CustomFormattersAppDelegate
  13. @synthesize window;
  14. - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
  15. {
  16. // Setup logging (with our custom formatter)
  17. TestFormatter *formatter = [[TestFormatter alloc] init];
  18. [[DDASLLogger sharedInstance] setLogFormatter:formatter];
  19. [[DDTTYLogger sharedInstance] setLogFormatter:formatter];
  20. [DDLog addLogger:[DDASLLogger sharedInstance]];
  21. [DDLog addLogger:[DDTTYLogger sharedInstance]];
  22. // Log some messages
  23. DDLogError(@"Paper Jam!");
  24. DDLogWarn(@"Low toner");
  25. DDLogInfo(@"Printing SalesProjections.doc");
  26. DDLogVerbose(@"Warming up toner");
  27. }
  28. @end