FBLogger.m 907 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /**
  2. * Copyright (c) 2015-present, Facebook, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the BSD-style license found in the
  6. * LICENSE file in the root directory of this source tree. An additional grant
  7. * of patent rights can be found in the PATENTS file in the same directory.
  8. */
  9. #import "FBLogger.h"
  10. #import "FBConfiguration.h"
  11. @implementation FBLogger
  12. + (void)log:(NSString *)message
  13. {
  14. NSLog(@"%@", message);
  15. }
  16. + (void)logFmt:(NSString *)format, ...
  17. {
  18. va_list args;
  19. va_start(args, format);
  20. NSLogv(format, args);
  21. va_end(args);
  22. }
  23. + (void)verboseLog:(NSString *)message
  24. {
  25. if (!FBConfiguration.verboseLoggingEnabled) {
  26. return;
  27. }
  28. [self log:message];
  29. }
  30. + (void)verboseLogFmt:(NSString *)format, ...
  31. {
  32. if (!FBConfiguration.verboseLoggingEnabled) {
  33. return;
  34. }
  35. va_list args;
  36. va_start(args, format);
  37. NSLogv(format, args);
  38. va_end(args);
  39. }
  40. @end