log.h 784 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef __XLOG_H__
  2. #define __XLOG_H__
  3. #pragma once
  4. #include "config.h"
  5. #include <stdarg.h>
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. #define XLOG_LEVEL_ALL 0
  10. #define XLOG_LEVEL_TRACE 1
  11. #define XLOG_LEVEL_DEBUG 2
  12. #define XLOG_LEVEL_INFO 3
  13. #define XLOG_LEVEL_WARN 4
  14. #define XLOG_LEVEL_ERROR 5
  15. #define XLOG_LEVEL_FATAL 6
  16. #define XLOG_LEVEL_NONE 7
  17. TOOLKIT_API int xlog_add_logger(const char *name, const char *type, ...);
  18. TOOLKIT_API int xlog_remove_logger(const char *name);
  19. TOOLKIT_API int xlog_init(const char *inifile);
  20. TOOLKIT_API int xlog_term();
  21. TOOLKIT_API int xlog_log(const char *inst, int level, const char *str);
  22. TOOLKIT_API int xlog_log_v(const char *inst, int level, const char *fmt, va_list arg);
  23. #ifdef __cplusplus
  24. } // extern "C" {
  25. #endif
  26. #endif //__XLOG_H__