sp_dbg.h 689 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef __SP_DBG_H__
  2. #define __SP_DBG_H__
  3. #pragma once
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. class spDbg
  8. {
  9. public:
  10. spDbg();
  11. int sp_dbg_init(const char *key);
  12. int sp_dbg_set_output_gui(void *gui);
  13. int sp_dbg_term();
  14. void sp_dbg_debug(const char *str, ...);
  15. void sp_dbg_info(const char *str, ...);
  16. void sp_dbg_warn(const char *str, ...);
  17. void sp_dbg_error(const char *str, ...);
  18. void sp_dbg_fatal(const char *str, ...);
  19. static spDbg *getInstance();
  20. void sp_dbg_log(int level, const char *str, va_list arg);
  21. private:
  22. private:
  23. char m_inst[128];
  24. int m_initialized;
  25. void *m_gui;
  26. char m_logkey[128];
  27. };
  28. #ifdef __cplusplus
  29. } // extern "C" {
  30. #endif
  31. #endif //__SP_DBG_H__