server/libthecore/include/log.h

40 lines
1.1 KiB
C
Raw Normal View History

2022-03-05 12:44:06 +02:00
#ifndef __INC_LIBTHECORE_LOG_H__
#define __INC_LIBTHECORE_LOG_H__
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
extern int log_init(void);
extern void log_destroy(void);
extern void log_rotate(void);
// <20>α<EFBFBD> <20><><EFBFBD><EFBFBD> ó<><C3B3> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> bitvector<6F><72> ó<><C3B3><EFBFBD>ȴ<EFBFBD>)
extern void log_set_level(unsigned int level);
extern void log_unset_level(unsigned int level);
// <20>α<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ŭ <20><><EFBFBD><EFBFBD><EFBFBD>ϴ°<CFB4><C2B0><EFBFBD> <20><><EFBFBD><EFBFBD> <20>Լ<EFBFBD>
extern void log_set_expiration_days(unsigned int days);
extern int log_get_expiration_days(void);
#ifndef __WIN32__
extern void _sys_err(const char *func, int line, const char *format, ...);
#else
extern void _sys_err(const char *func, int line, const char *format, ...);
#endif
extern void sys_log_header(const char *header);
extern void sys_log(unsigned int lv, const char *format, ...);
extern void pt_log(const char *format, ...);
#ifndef __WIN32__
#define sys_err(fmt, args...) _sys_err(__FUNCTION__, __LINE__, fmt, ##args)
#else
#define sys_err(fmt, ...) _sys_err(__FUNCTION__, __LINE__, fmt, __VA_ARGS__)
#endif // __WIN32__
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // __INC_LOG_H__