-
Notifications
You must be signed in to change notification settings - Fork 0
IamHuskar/slog
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
simple logger v1.0 if init with config file /* splog.cfg ascii file filename@loglevel@logtype logtype=[tofile toconsole] loglevel=[debug,info,warning,error,fatal] example log.txt@warning@tofile */ or #define SLOG_DEFAULT_INIT splog::logger GLOG; #define SLOG_TOFILE_LEVEL_INIT(log_filename,loglevel) SLOG_COMMON_INIT(log_filename,loglevel,NULL) #define SLOG_TOFILE_INIT(log_filename) SLOG_TOFILE_LEVEL_INIT(log_filename,(splog::LOGL_DEBUG)) #define SLOG_CFG_INIT(cfg_filename) SLOG_TOFILE_LEVEL_INIT(DEFAULT_LOG_FILENAME,(splog::LOGL_DEBUG),cfg_filename) #define SLOG_CFG_DEFAULT_INIT SLOG_CFG_INIT(DEFAULT_CFG_FILENAME) /* default log write */ #define SLOG_DEBUG(foramt,...) GLOG.log_fmt_debug(foramt,##__VA_ARGS__) #define SLOG_INFO(foramt,...) GLOG.log_fmt_info(foramt,##__VA_ARGS__) #define SLOG_WARNING(foramt,...) GLOG.log_fmt_warning(foramt,##__VA_ARGS__) #define SLOG_ERROR(foramt,...) GLOG.log_fmt_error(foramt,##__VA_ARGS__) #define SLOG_FATAL(foramt,...) GLOG.log_fmt_fatal(foramt,##__VA_ARGS__) V1.1 2017.3.3.23 support linux version add function name ,thread id information support set_log_flag() #define SLTIME 1 time #define SLTID 2 threadid #define SLSRCFL 4 filename line number #define SLLEVEL 8 level info #define SLMSG 16 sufix info #define SLFUNCNAME 32 function name #define SLALL (SLTIME|SLTID|SLSRCFL|SLLEVEL|SLMSG|SLFUNCNAME) SET_LOG_FLAG(SLALL) v1.1.1 2017.6.12 add convenient error info function #define SLOG_INVALID_ARGS SLOG_FATAL("INVALID ARGUMENTS"); #define SLOG_NULL_POINTER SLOG_FATAL("NULL POINTER"); #define SLOG_BUFFER_TOO_SMALL SLOG_FATAL("DATA OR BUFFER TOO SMALL"); #define SLOG_BUFFER_TOO_LARGE SLOG_FATAL("DATA OR BUFFER TOO LARGE"); #define SLOG_REACHHERE SLOG_FATAL("REACH HERE"); #define SLOG_SYS_API_ERROR SLOG_FATAL("CALL SYSAPI ERROR");
About
simple logger in c++
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published