Без опису

FIRInstanceIDLogger.h 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright 2019 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import "FIRIMessageCode.h"
  17. // The convenience macros are only defined if they haven't already been defined.
  18. #ifndef FIRInstanceIDLoggerInfo
  19. // Convenience macros that log to the shared GTMLogger instance. These macros
  20. // are how users should typically log to FIRInstanceIDLogger.
  21. #define FIRInstanceIDLoggerDebug(code, ...) \
  22. [FIRInstanceIDSharedLogger() logFuncDebug:__func__ messageCode:code msg:__VA_ARGS__]
  23. #define FIRInstanceIDLoggerInfo(code, ...) \
  24. [FIRInstanceIDSharedLogger() logFuncInfo:__func__ messageCode:code msg:__VA_ARGS__]
  25. #define FIRInstanceIDLoggerNotice(code, ...) \
  26. [FIRInstanceIDSharedLogger() logFuncNotice:__func__ messageCode:code msg:__VA_ARGS__]
  27. #define FIRInstanceIDLoggerWarning(code, ...) \
  28. [FIRInstanceIDSharedLogger() logFuncWarning:__func__ messageCode:code msg:__VA_ARGS__]
  29. #define FIRInstanceIDLoggerError(code, ...) \
  30. [FIRInstanceIDSharedLogger() logFuncError:__func__ messageCode:code msg:__VA_ARGS__]
  31. #endif // !defined(FIRInstanceIDLoggerInfo)
  32. @interface FIRInstanceIDLogger : NSObject
  33. - (void)logFuncDebug:(const char *)func
  34. messageCode:(FIRInstanceIDMessageCode)messageCode
  35. msg:(NSString *)fmt, ... NS_FORMAT_FUNCTION(3, 4);
  36. - (void)logFuncInfo:(const char *)func
  37. messageCode:(FIRInstanceIDMessageCode)messageCode
  38. msg:(NSString *)fmt, ... NS_FORMAT_FUNCTION(3, 4);
  39. - (void)logFuncNotice:(const char *)func
  40. messageCode:(FIRInstanceIDMessageCode)messageCode
  41. msg:(NSString *)fmt, ... NS_FORMAT_FUNCTION(3, 4);
  42. - (void)logFuncWarning:(const char *)func
  43. messageCode:(FIRInstanceIDMessageCode)messageCode
  44. msg:(NSString *)fmt, ... NS_FORMAT_FUNCTION(3, 4);
  45. - (void)logFuncError:(const char *)func
  46. messageCode:(FIRInstanceIDMessageCode)messageCode
  47. msg:(NSString *)fmt, ... NS_FORMAT_FUNCTION(3, 4);
  48. @end
  49. /**
  50. * Instantiates and/or returns a shared GTMLogger used exclusively
  51. * for InstanceID log messages.
  52. * @return the shared GTMLogger instance
  53. */
  54. FIRInstanceIDLogger *FIRInstanceIDSharedLogger(void);