AppDelegate.m 1021 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #import "AppDelegate.h"
  2. #import <CocoaLumberjack/CocoaLumberjack.h>
  3. #import <CocoaLumberjack/DDTTYLogger.h>
  4. // Log levels: off, error, warn, info, verbose
  5. static const DDLogLevel ddLogLevel = DDLogLevelVerbose;
  6. @interface AppDelegate ()
  7. @property (weak) IBOutlet NSWindow *window;
  8. @end
  9. @implementation AppDelegate
  10. - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
  11. {
  12. [DDLog addLogger:[DDTTYLogger sharedInstance]];
  13. DDLogVerbose(@"Verbose");
  14. DDLogInfo(@"Info");
  15. DDLogWarn(@"Warn");
  16. DDLogError(@"Error");
  17. DDLog *aDDLogInstance = [DDLog new];
  18. [aDDLogInstance addLogger:[DDTTYLogger sharedInstance]];
  19. DDLogVerboseToDDLog(aDDLogInstance, @"Verbose from aDDLogInstance");
  20. DDLogInfoToDDLog(aDDLogInstance, @"Info from aDDLogInstance");
  21. DDLogWarnToDDLog(aDDLogInstance, @"Warn from aDDLogInstance");
  22. DDLogErrorToDDLog(aDDLogInstance, @"Error from aDDLogInstance");
  23. }
  24. - (void)applicationWillTerminate:(NSNotification *)aNotification
  25. {
  26. }
  27. @end