猎豆优选

TBSDKLogUtil.h 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // Created by wuchen.xj on 1/28/19.
  3. // Copyright (c) 2019 Taobao. All rights reserved.
  4. //
  5. #import <Foundation/Foundation.h>
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. /**
  10. * 日志开关函数(保持向后兼容,此函数一直保留)
  11. */
  12. void openSDKSwitchLog(BOOL flag);
  13. #ifdef __cplusplus
  14. }
  15. #endif
  16. /**
  17. * MTOP日志级别
  18. */
  19. typedef NS_OPTIONS(NSUInteger, TBSDKMTOPLogLevel) {
  20. kMTOPLogDebug = 4,
  21. kMTOPLogInfo = 3,
  22. kMTOPLogWarnning = 2,
  23. kMTOPLogError = 1
  24. };
  25. /**
  26. * MTOP日志打印入口
  27. */
  28. @interface TBSDKLogUtil : NSObject
  29. + (void)log:(TBSDKMTOPLogLevel)level file:(const char *)file func:(const char *)func line:(int)line msg:(NSString *)fmt, ...;
  30. @end
  31. #define MTOP_LOGD(...) [TBSDKLogUtil log:kMTOPLogDebug file:__FILE__ func:__func__ line:__LINE__ msg:__VA_ARGS__];
  32. #define MTOP_LOGI(...) [TBSDKLogUtil log:kMTOPLogInfo file:__FILE__ func:__func__ line:__LINE__ msg:__VA_ARGS__];
  33. #define MTOP_LOGW(...) [TBSDKLogUtil log:kMTOPLogWarnning file:__FILE__ func:__func__ line:__LINE__ msg:__VA_ARGS__];
  34. #define MTOP_LOGE(...) [TBSDKLogUtil log:kMTOPLogError file:__FILE__ func:__func__ line:__LINE__ msg:__VA_ARGS__];