GlobalLogLevelAppDelegate.m 880 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // GlobalLogLevelAppDelegate.m
  3. // GlobalLogLevel
  4. //
  5. // CocoaLumberjack Demos
  6. //
  7. #import "GlobalLogLevelAppDelegate.h"
  8. #import "Stuff.h"
  9. #import "MyLogging.h"
  10. DDLogLevel ddLogLevel;
  11. @implementation GlobalLogLevelAppDelegate
  12. @synthesize window;
  13. void someFunction()
  14. {
  15. DDLogError(@"%@: C_Error", THIS_FILE);
  16. DDLogWarn(@"%@: C_Warn", THIS_FILE);
  17. DDLogInfo(@"%@: C_Info", THIS_FILE);
  18. DDLogVerbose(@"%@: C_Verbose", THIS_FILE);
  19. }
  20. - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
  21. {
  22. ddLogLevel = DDLogLevelVerbose;
  23. [DDLog addLogger:[DDTTYLogger sharedInstance]];
  24. DDLogError(@"%@: Error", THIS_FILE);
  25. DDLogWarn(@"%@: Warn", THIS_FILE);
  26. DDLogInfo(@"%@: Info", THIS_FILE);
  27. DDLogVerbose(@"%@: Verbose", THIS_FILE);
  28. someFunction();
  29. ddLogLevel = DDLogLevelWarning;
  30. [Stuff doStuff];
  31. }
  32. @end