GlobalLogLevelAppDelegate.m 793 B

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