VclLog.h 1018 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // YSXLog.h
  3. // YSXCrash
  4. //
  5. // Created by Felix on 2018/8/24.
  6. // Copyright © 2018年 Felix. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #ifdef Debug
  10. #define YSXDebugLog(FORMAT, ...) a_YSXLOG_FULL(FORMAT, "Debug", ##__VA_ARGS__)
  11. #define YSXErrorLog(FORMAT, ...) a_YSXLOG_FULL(FORMAT, "Error", ##__VA_ARGS__)
  12. #else
  13. #define YSXDebugLog(...)
  14. #define YSXErrorLog(...)
  15. #endif
  16. #define a_YSXLOG_FULL(FORMAT, level, ...) \
  17. i_YSXLOG_FULL( \
  18. level, \
  19. __FILE__, \
  20. __LINE__, \
  21. __PRETTY_FUNCTION__, \
  22. FORMAT, \
  23. ##__VA_ARGS__)
  24. #define i_YSXLOG_FULL i_ysxlog_logObjC
  25. void i_ysxlog_logC(const char *file, int line, const char *function, NSString *fmt, ...);
  26. void i_ysxlog_logObjC(const char* const level, const char* const file, const int line, const char* const function, NSString *fmt, ...);