AntLogLevel.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // AntLogLevel.h
  3. // AntLog
  4. //
  5. // Created by 卡迩 on 2017/1/28.
  6. // Copyright © 2017年 Alipay. All rights reserved.
  7. //
  8. #ifndef AntLogLevel_h
  9. #define AntLogLevel_h
  10. /**
  11. * 日志等级
  12. */
  13. typedef NS_ENUM(NSInteger,AntLogLevel) {
  14. AntLogLevelHigh = 1, //级别最高
  15. AntLogLevelNormal = 2, //默认级别
  16. AntLogLevelLow = 3 //级别最低
  17. };
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. /**
  22. * 将字符串类型的等级转换成枚举
  23. * @param str 字符串类型的logLevel,支持@"1"或者@"level1"
  24. */
  25. AntLogLevel AntLogLevelFromString(NSString *str);
  26. #ifdef SDK_IS4_ALIPAY
  27. /**
  28. * 将枚举类型的logLevel转换成字符串
  29. * @param level logLevel
  30. * @return level对应的字符串,@"1"、@"2"、@"3"中的一个
  31. */
  32. NSString *AntLogLevelToString(AntLogLevel level);
  33. #endif
  34. /**
  35. * 兼容老接口,从扩展Map中获取logLevel值
  36. * @param dict 扩展Map
  37. */
  38. AntLogLevel AntLogLevelFromFormatterDict(NSDictionary *dict);
  39. #ifdef __cplusplus
  40. }
  41. #endif
  42. #endif /* AntLogLevel_h */