123456789101112131415161718192021222324252627282930313233343536373839 |
- #ifndef __SP_DBG_H__
- #define __SP_DBG_H__
- #pragma once
- #ifdef __cplusplus
- extern "C" {
- #endif
- class spDbg
- {
- public:
- spDbg();
- int sp_dbg_init(const char *key);
- int sp_dbg_set_level(int level);
- int sp_dbg_set_output_gui(void *gui);
- int sp_dbg_term();
- void sp_dbg_trace(const char* str, ...);
- void sp_dbg_debug(const char *str, ...);
- void sp_dbg_info(const char *str, ...);
- void sp_dbg_warn(const char *str, ...);
- void sp_dbg_error(const char *str, ...);
- void sp_dbg_fatal(const char *str, ...);
- static spDbg *getInstance();
- void sp_dbg_log(int level, const char *str, va_list arg);
- void sp_dbg_logOutMsg(int level, const char* str, va_list arg);
- private:
- void sp_dbg_buffer_with_level(const char* buf, int level);
- char m_inst[128];
- int m_initialized;
- void *m_gui;
- char m_logkey[128];
- };
- #ifdef __cplusplus
- } // extern "C" {
- #endif
- #endif //__SP_DBG_H__
|