T-Box Basic dev
Loading...
Searching...
No Matches
slog 可选功能接口

slog_funcs_style_cover More...

Topics

 slog 接口命名风格替换宏
 

Macros

#define func_filter_log   funcFilterLog
#define func_encrypt_log   funcEncryptLog
#define SLOG_MAXCNT_CUST_LABEL   5
#define SLOG_MAXLEN_CUST_LABEL   64
#define SLOG_OPTION_INVALID   -1
#define SLOG_OPTION_OPEN_AND_CLOSE   0x1
#define SLOG_OPTION_CHANGE_TEST   0x2
#define SLOG_OPTION_OPEN_ONCE   0x4
#define SLOG_OPTION_SET_OUTPUT_BY_FILENAME   0x8
#define SLOG_OPTION_ENCRYPT   0x10
#define SLOG_OPTION_OPEN_DEFAULT   SLOG_OPTION_CHANGE_TEST
#define SLOG_CUST_LABELS_COUNT   30
#define SLOG_ROTATEMODE_INVALID   -1
#define SLOG_ROTATEMODE_NONE   0
#define SLOG_ROTATEMODE_SIZE   1
#define SLOG_ROTATEMODE_PER_DAY   2
#define SLOG_ROTATEMODE_PER_HOUR   3
#define SLOG_ROTATE_SIZE_FILE_COUNT_DEFAULT   99999999
#define SLOG_ROTATE_SIZE_PRESSURE_FACTOR_DEFAULT   0
#define SLOG_FSYNC_PERIOD   10000
#define func_before_rotate_file   funcBeforeRotateFile
#define func_after_rotate_file   funcAfterRotateFile
#define SLOG_BUFSIZE_DEFAULT   (1024)
#define SLOG_BUFSIZE_MAX   (1024 * 1024)
#define SLOG_HEXLOG_BUFSIZE_DEFAULT   (16 * 1024)
#define SLOG_HEXLOG_BUFSIZE_MAX   (10 * 1024 * 1024)

Typedefs

typedef int funcFilterLog(SLOG *g, void **open_handle, int log_level, char *buf, long len)
typedef int funcEncryptLog(SLOG *g, const char *plaintext, char *ciphertext, long len)
typedef int funcBeforeRotateFile(SLOG *g, char *rotate_log_pathfilename)
typedef int funcAfterRotateFile(SLOG *g, char *rotate_log_pathfilename)

Functions

_SLOG_FUNC int SetLogOptions (SLOG *g, int log_options)
_SLOG_FUNC int SetLogFileChangeTest (SLOG *g, long interval)
_SLOG_FUNC int SetLogFsyncPeriod (SLOG *g, long period)
_SLOG_FUNC int SetLogCustLabel (SLOG *g, int index, char *cust_label)
_SLOG_FUNC int SetLogRotateMode (SLOG *g, int rotate_mode)
_SLOG_FUNC int SetLogRotateSize (SLOG *g, long log_rotate_size)
_SLOG_FUNC int SetLogRotatePressureFactor (SLOG *g, long pressure_factor)
_SLOG_FUNC int SetLogRotateFileCount (SLOG *g, long rotate_file_count)
_SLOG_FUNC int SetLogRotateFileNo (SLOG *g, long rotate_file_no)
_SLOG_FUNC long GetLogRotateFileNo (SLOG *g)
_SLOG_FUNC int SetBeforeRotateFileFunc (SLOG *g, funcAfterRotateFile *pfuncAfterRotateFile)
_SLOG_FUNC int SetAfterRotateFileFunc (SLOG *g, funcAfterRotateFile *pfuncAfterRotateFile)
_SLOG_FUNC int SetFilterLogFunc (SLOG *g, funcFilterLog *pfuncFilterLog)
_SLOG_FUNC int SetEncryptLogFunc (SLOG *g, funcEncryptLog *pfuncEncryptLog)
_SLOG_FUNC int SetLogBufferSize (SLOG *g, long log_bufsize, long max_log_bufsize)
_SLOG_FUNC int SetHexLogBufferSize (SLOG *g, long hexlog_bufsize, long max_log_hexbufsize)
_SLOG_FUNC int SetLogOutputFuncDirectly (SLOG *g, funcOpenLog *pfuncOpenLogPrepare, funcOpenLog *pfuncOpenLog, funcWriteLog *pfuncWriteLog, funcChangeTest *pfuncChangeTest, funcCloseLog *pfuncCloseLog, funcCloseLog *pfuncCloseLogEnd)
_SLOG_FUNC int SetLogStyleFuncDirectly (SLOG *g, funcLogStyle *pfuncLogStyle)

Detailed Description

slog_funcs_style_cover

线程安全函数可选功能接口 optional function macros

定义了一些线程安全的函数,包括设置日志选项、设置日志文件改变测试、设置日志文件同步周期、设置自定义标签、设置日志旋转模式、设置日志旋转大小、设置日志旋转压力因子、设置日志旋转文件计数、设置日志旋转前回调函数等。