ZeroErr
zeroerr::LogInfo Struct Reference

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

#include <log.h>

Collaboration diagram for zeroerr::LogInfo:

Public Member Functions

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

Public Attributes

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

Detailed Description

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 = }

Constructor & Destructor Documentation

◆ LogInfo()

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

Member Data Documentation

◆ 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

The documentation for this struct was generated from the following files: