TwiceAsNice
2019-02-18
|
#include <string>
#include <sstream>
#include <errno.h>
#include <stdio.h>
Classes | |
class | ILog4zManager |
log4z class More... | |
class | Log4zBinary |
optimze from std::stringstream to Log4zStream More... | |
class | Log4zStream |
Typedefs | |
typedef int | LoggerId |
logger ID type. DO NOT TOUCH More... | |
Enumerations | |
enum | ENUM_LOG_LEVEL { LOG_LEVEL_TRACE = 0, LOG_LEVEL_DEBUG, LOG_LEVEL_INFO, LOG_LEVEL_WARN, LOG_LEVEL_ERROR, LOG_LEVEL_ALARM, LOG_LEVEL_FATAL } |
LOG Level. More... | |
Variables | |
const int | LOG4Z_INVALID_LOGGER_ID = -1 |
the invalid logger id. DO NOT TOUCH More... | |
const int | LOG4Z_MAIN_LOGGER_ID = 0 |
the main logger id. More... | |
const char *const | LOG4Z_MAIN_LOGGER_KEY = "Main" |
the main logger name. DO NOT TOUCH More... | |
const int | LOG4Z_LOGGER_MAX = 10 |
--------------—default logger config, can change on this.--------— /////////////////////////////////////////////////////////////////////// the max logger count. More... | |
const int | LOG4Z_LOG_BUF_SIZE = 2048 |
the max log content length. More... | |
const bool | LOG4Z_ALL_SYNCHRONOUS_OUTPUT = false |
all logger synchronous output or not More... | |
const bool | LOG4Z_ALL_DEBUGOUTPUT_DISPLAY = false |
all logger synchronous display to the windows debug output More... | |
const char *const | LOG4Z_DEFAULT_PATH = "./log/" |
default logger output file. More... | |
const int | LOG4Z_DEFAULT_LEVEL = LOG_LEVEL_DEBUG |
default log filter level More... | |
const bool | LOG4Z_DEFAULT_DISPLAY = true |
default logger display More... | |
const bool | LOG4Z_DEFAULT_OUTFILE = true |
default logger output to file More... | |
const bool | LOG4Z_DEFAULT_MONTHDIR = false |
default logger month dir used status More... | |
const int | LOG4Z_DEFAULT_LIMITSIZE = 100 |
default logger output file limit size, unit M byte. More... | |
const bool | LOG4Z_DEFAULT_SHOWSUFFIX = true |
default logger show suffix (file name and line number) More... | |
#define _ZSUMMER_BEGIN namespace zsummer { |
#define _ZSUMMER_END } |
#define _ZSUMMER_LOG4Z_BEGIN namespace log4z { |
#define _ZSUMMER_LOG4Z_END } |
#define _ZSUMMER_LOG4Z_H_ |
#define LOG4Z_FORMAT_INPUT_ENABLE |
check VC VERSION.
DO NOT TOUCH format micro cannot support VC6 or VS2003, please use stream input log, like LOGI, LOGD, LOG_DEBUG, LOG_STREAM ...
#define LOG_ALARM | ( | id, | |
log | |||
) | LOG_STREAM(id, LOG_LEVEL_ALARM, log) |
#define LOG_DEBUG | ( | id, | |
log | |||
) | LOG_STREAM(id, LOG_LEVEL_DEBUG, log) |
#define LOG_ERROR | ( | id, | |
log | |||
) | LOG_STREAM(id, LOG_LEVEL_ERROR, log) |
#define LOG_FATAL | ( | id, | |
log | |||
) | LOG_STREAM(id, LOG_LEVEL_FATAL, log) |
#define LOG_FORMAT | ( | id, | |
level, | |||
logformat, | |||
... | |||
) |
format input log.
#define LOG_INFO | ( | id, | |
log | |||
) | LOG_STREAM(id, LOG_LEVEL_INFO, log) |
#define LOG_STREAM | ( | id, | |
level, | |||
log | |||
) |
base micro.
#define LOG_TRACE | ( | id, | |
log | |||
) | LOG_STREAM(id, LOG_LEVEL_TRACE, log) |
fast micro
#define LOG_WARN | ( | id, | |
log | |||
) | LOG_STREAM(id, LOG_LEVEL_WARN, log) |
#define LOGA | ( | log | ) | LOG_ALARM(LOG4Z_MAIN_LOGGER_ID, log ) |
#define LOGD | ( | log | ) | LOG_DEBUG(LOG4Z_MAIN_LOGGER_ID, log ) |
#define LOGE | ( | log | ) | LOG_ERROR(LOG4Z_MAIN_LOGGER_ID, log ) |
#define LOGF | ( | log | ) | LOG_FATAL(LOG4Z_MAIN_LOGGER_ID, log ) |
#define LOGFMT_ALARM | ( | id, | |
fmt, | |||
... | |||
) | LOG_FORMAT(id, LOG_LEVEL_ALARM, fmt, ##__VA_ARGS__) |
#define LOGFMT_DEBUG | ( | id, | |
fmt, | |||
... | |||
) | LOG_FORMAT(id, LOG_LEVEL_DEBUG, fmt, ##__VA_ARGS__) |
#define LOGFMT_ERROR | ( | id, | |
fmt, | |||
... | |||
) | LOG_FORMAT(id, LOG_LEVEL_ERROR, fmt, ##__VA_ARGS__) |
#define LOGFMT_FATAL | ( | id, | |
fmt, | |||
... | |||
) | LOG_FORMAT(id, LOG_LEVEL_FATAL, fmt, ##__VA_ARGS__) |
#define LOGFMT_INFO | ( | id, | |
fmt, | |||
... | |||
) | LOG_FORMAT(id, LOG_LEVEL_INFO, fmt, ##__VA_ARGS__) |
#define LOGFMT_TRACE | ( | id, | |
fmt, | |||
... | |||
) | LOG_FORMAT(id, LOG_LEVEL_TRACE, fmt, ##__VA_ARGS__) |
format string
#define LOGFMT_WARN | ( | id, | |
fmt, | |||
... | |||
) | LOG_FORMAT(id, LOG_LEVEL_WARN, fmt, ##__VA_ARGS__) |
#define LOGFMTA | ( | fmt, | |
... | |||
) | LOGFMT_ALARM(LOG4Z_MAIN_LOGGER_ID, fmt, ##__VA_ARGS__) |
#define LOGFMTD | ( | fmt, | |
... | |||
) | LOGFMT_DEBUG(LOG4Z_MAIN_LOGGER_ID, fmt, ##__VA_ARGS__) |
#define LOGFMTE | ( | fmt, | |
... | |||
) | LOGFMT_ERROR(LOG4Z_MAIN_LOGGER_ID, fmt, ##__VA_ARGS__) |
#define LOGFMTF | ( | fmt, | |
... | |||
) | LOGFMT_FATAL(LOG4Z_MAIN_LOGGER_ID, fmt, ##__VA_ARGS__) |
#define LOGFMTI | ( | fmt, | |
... | |||
) | LOGFMT_INFO(LOG4Z_MAIN_LOGGER_ID, fmt, ##__VA_ARGS__) |
#define LOGFMTT | ( | fmt, | |
... | |||
) | LOGFMT_TRACE(LOG4Z_MAIN_LOGGER_ID, fmt, ##__VA_ARGS__) |
#define LOGFMTW | ( | fmt, | |
... | |||
) | LOGFMT_WARN(LOG4Z_MAIN_LOGGER_ID, fmt, ##__VA_ARGS__) |
#define LOGI | ( | log | ) | LOG_INFO(LOG4Z_MAIN_LOGGER_ID, log ) |
#define LOGT | ( | log | ) | LOG_TRACE(LOG4Z_MAIN_LOGGER_ID, log ) |
super micro.
#define LOGW | ( | log | ) | LOG_WARN(LOG4Z_MAIN_LOGGER_ID, log ) |
typedef int LoggerId |
logger ID type. DO NOT TOUCH
enum ENUM_LOG_LEVEL |
all logger synchronous display to the windows debug output
const int LOG4Z_DEFAULT_LEVEL = LOG_LEVEL_DEBUG |
default log filter level
const int LOG4Z_DEFAULT_LIMITSIZE = 100 |
default logger output file limit size, unit M byte.
const int LOG4Z_INVALID_LOGGER_ID = -1 |
the invalid logger id. DO NOT TOUCH
const int LOG4Z_LOG_BUF_SIZE = 2048 |
the max log content length.
const int LOG4Z_LOGGER_MAX = 10 |
--------------—default logger config, can change on this.--------— /////////////////////////////////////////////////////////////////////// the max logger count.
const int LOG4Z_MAIN_LOGGER_ID = 0 |
the main logger id.
DO NOT TOUCH can use this id to set the main logger's attribute. example: ILog4zManager::getPtr()->setLoggerLevel(LOG4Z_MAIN_LOGGER_ID, LOG_LEVEL_WARN); ILog4zManager::getPtr()->setLoggerDisplay(LOG4Z_MAIN_LOGGER_ID, false);