ZeroErr
载入中...
搜索中...
未找到
zeroerr::LogInfo结构体 参考

LogInfo is a struct to store the meta data of the log message. 更多...

#include <log.h>

zeroerr::LogInfo 的协作图:

Public 成员函数

 LogInfo (const char *filename, const char *function, const char *message, const char *category, unsigned line, unsigned size, LogSeverity severity)
 

Public 属性

const char * filename
 
const char * function
 
const char * message
 
const char * category
 
unsigned line
 
unsigned size
 
LogSeverity severity
 
std::map< std::string, int > names
 

详细描述

LogInfo is a struct to store the meta data of the log message.

LogInfo is a struct to store the meta data of the log message. It contains filename, function, message, category, line number, size, and severity. Those data is initialized when the first log message is created using a static local variable in the function where the log message is put.

For example: void foo() { log("Hello, {name}!", "John"); }

The inner implementation could be considered as (not exactly since message is allocated from a pool): void foo() { static LogInfo log_info{ FILE, func, "Hello, {name}!", ZEROERR_LOG_CATEGORY, LINE, sizeof("Hello, world!"), LogSeverity::INFO_l); LogMessage* logdata = new LogMessageImpl<std::string>("John"); logdata->info = &log_info; }

构造及析构函数说明

◆ LogInfo()

zeroerr::LogInfo::LogInfo ( const char *  filename,
const char *  function,
const char *  message,
const char *  category,
unsigned  line,
unsigned  size,
LogSeverity  severity 
)

类成员变量说明

◆ category

const char* zeroerr::LogInfo::category

◆ filename

const char* zeroerr::LogInfo::filename

◆ function

const char* zeroerr::LogInfo::function

◆ line

unsigned zeroerr::LogInfo::line

◆ message

const char* zeroerr::LogInfo::message

◆ names

std::map<std::string, int> zeroerr::LogInfo::names

◆ severity

LogSeverity zeroerr::LogInfo::severity

◆ size

unsigned zeroerr::LogInfo::size

该结构体的文档由以下文件生成: