BULogMacros.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // BULogMacros.h
  3. // BUFoundation
  4. //
  5. // Created by Rush.D.Xzj on 2021/2/2.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import "BULogManager.h"
  9. /** LOG **/
  10. #define BU_Log_Foundation(frmt, ...) BU_LOG_MAYBE(BUFoundationLog, BU_LOG_ENABLED, frmt, ##__VA_ARGS__)
  11. #define BU_LOG_MAYBE(BULogTypeString, flg, frmt, ...) \
  12. do { \
  13. if(flg) [BULogManager debugLogWithFormat:@"[PangleUnion-%@]-[debug]-[%@]%@", BUSDKVersion, BULogTypeString, [NSString stringWithFormat:frmt,##__VA_ARGS__]]; \
  14. } while(0)
  15. #define BU_LogErrorD(BULogType, frmt, ...) BU_LogBaseD(error, BULogType, frmt, ##__VA_ARGS__)
  16. #define BU_LogWaringD(BULogType, frmt, ...) BU_LogBaseD(warning, BULogType, frmt, ##__VA_ARGS__)
  17. #define BU_LogInfoD(BULogType, frmt, ...) BU_LogBaseD(info, BULogType, frmt, ##__VA_ARGS__)
  18. #define BU_LogDebugD(BULogType, frmt, ...) BU_LogBaseD(debug, BULogType, frmt, ##__VA_ARGS__)
  19. #define BU_LogVerboseD(BULogType, frmt, ...) BU_LogBaseD(verbose, BULogType, frmt, ##__VA_ARGS__)
  20. #define BU_LogInternalD(BULogType, frmt, ...) BU_LogBaseD(internal, BULogType, frmt, ##__VA_ARGS__)
  21. #define BU_LogBaseD(level, BULogType, frmt, ...) [BULogManager level##LogWithFormat:@"[PangleUnion-%@]-[%s]-[%@]%@", BUSDKVersion, #level, BULogType, [NSString stringWithFormat:frmt, ##__VA_ARGS__]];
  22. FOUNDATION_EXPORT NSString * const BUFoundationLog;
  23. FOUNDATION_EXPORT BOOL BU_LOG_ENABLED;