log.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef __LOG_H_
  2. #define __LOG_H_
  3. #if defined PLATFORM_MS5700
  4. #define LOG_TO_LSAPI //printf log by LSAPI_Log_Debug
  5. #elif defined PLATFORM_U9507C || defined PLATFORM_EC20
  6. #define LOG_TO_WIN //printf log by printf function
  7. #endif
  8. #if defined LOG_TO_WIN
  9. #define ON_SHOW_INFO(info) printf("%s",info)
  10. #elif defined LOG_TO_LSAPI
  11. #include "lsapi_sys.h"
  12. #define ON_SHOW_INFO(info) LSAPI_Log_Debug(info)
  13. #else
  14. #error "You need to make a choise for log LOG_TYPE"
  15. #endif
  16. #ifndef NULL
  17. #define NULL 0
  18. #endif
  19. void wjlprintf(const char *level,const char *format,...);
  20. #if 0
  21. #define wlog_info(...) LSAPI_Log_Debug(__VA_ARGS__)
  22. #define wlog_warn(...) LSAPI_Log_Debug(__VA_ARGS__)
  23. #define wlog_error(...) LSAPI_Log_Debug(__VA_ARGS__)
  24. #else//处理完snprintf的错误后可使用以下
  25. #define wlog_info(...) wjlprintf("info",__VA_ARGS__)
  26. #define wlog_warn(...) wjlprintf("warn",__VA_ARGS__)
  27. #define wlog_error(...) wjlprintf("erro",__VA_ARGS__)
  28. #define wlog_debug(...)
  29. #endif
  30. void setLogRoute(char typeUsb, char typeOutter);
  31. #endif