目录

Log

Class Info

class Log

日志类。包含日志记录器的注册、注销,及char数组类型数据作为log信息输出。

需定义宏:

#define CGKIT_LOG

以启用日志,并设置日志等级以打印对应级别日志,如设置为:

Log::SetLogLevel(LOG_VERBOSE)

Public Constructor Summary

Constructor Name

Log()

构造函数。

Public Destructor Summary

Destructor Name

~Log()

析构函数。

Public Method Summary

Qualifier and Type

Method Name and Description

static void

Initialize()

初始化日志记录器,包括注册日志记录器和使能日志记录器。

static void

Uninitialize()

反初始化日志记录器,清空日志记录映射表。

static void

SetLogLevel(LogType logType)

设置日志级别,即日志输出类型。

static void

WriteLog(LogType type, String func, String file, int line, const char* fmt, ...)

将log信息写入日志缓冲区。

static void

Write(LogType type, const char* text)

char数组类型信息添加时间戳后写入log缓冲区。

Public Constructors

[h2]Log

Constructor

Log()

构造函数。

Public Destructors

[h2]~Log

Destructor

~Log()

析构函数。

Public Methods

[h2]Initialize

Method

static void Initialize()

初始化日志记录器,包括注册日志记录器和使能日志记录器。

[h2]Uninitialize

Method

static void Uninitialize()

反初始化日志记录器,清空日志记录映射表。

[h2]SetLogLevel

Method

static void SetLogLevel(LogType logType)

设置日志级别,即日志输出类型。

Parameters

Name

Description

logType

日志输出类型。参见LogType。

[h2]WriteLog

Method

static void WriteLog(LogType type, String func, String file, int line, const char* fmt, ...)

将log信息写入日志缓冲区。

Parameters

Name

Description

type

日志输出类型。参见LogType。

func

函数名称。

file

文件名称。

line

行数。

fmt

日志格式。

[h2]Write

Method

static void Write(LogType type, const char* text)

char数组类型信息添加时间戳后写入log缓冲区。

Parameters

Name

Description

type

日志输出类型。参见LogType。

text

char数组类型文本信息。