dl
dl::LogSystem类 参考

日志系统 更多...

#include <dl_log.h>

类

struct  Setting
 

Public 类型

enum class  Level {
  DAMAGE , ERR , WARN , NOTICE ,
  MSG , INFO , TEST , PAUSE
}
 日志等级 越小越严重 更多...
 

Public 成员函数

 LogSystem ()
 
const Setting & GetSetting ()
 返回当前设置
 
void SetLogFile (std::string_view path, std::string_view name={})
 设置日志文件路径(非线程安全)
 
std::string GetLogFile ()
 
void PushLevelLimit (Level level)
 设置日志输出等级
 
void PopLevelLimit ()
 
bool IsLevelLimit (Level level)
 
bool IsLevelMsgBox (Level level)
 检查等级是否可以弹窗(小于等于自己)
 
void SetLevelMsgBox (Level level)
 设置弹窗等级(小于等于自己才弹,越小越严重)
 
void Push (const Setting &setting)
 入栈设置
 
void PushLevel (Level level)
 入栈设置
 
void Pop ()
 出栈设置
 
std::mutex & GetMutex ()
 

静态 Public 成员函数

static std::string_view Level2String (Level level)
 日志等级转字符串
 

详细描述

日志系统

在文件 dl_log.h 第 36 行定义.

成员枚举类型说明

◆ Level

enum class dl::LogSystem::Level
strong

日志等级 越小越严重

枚举值
DAMAGE 
ERR 
WARN 
NOTICE 
MSG 
INFO 
TEST 
PAUSE 

在文件 dl_log.h 第 40 行定义.

构造及析构函数说明

◆ LogSystem()

dl::LogSystem::LogSystem ( )

成员函数说明

◆ GetLogFile()

std::string dl::LogSystem::GetLogFile ( )
inline

在文件 dl_log.h 第 75 行定义.

◆ GetMutex()

std::mutex & dl::LogSystem::GetMutex ( )
inline

在文件 dl_log.h 第 144 行定义.

◆ GetSetting()

const Setting & dl::LogSystem::GetSetting ( )
inline

返回当前设置

在文件 dl_log.h 第 61 行定义.

◆ IsLevelLimit()

bool dl::LogSystem::IsLevelLimit ( Level level)
inline

在文件 dl_log.h 第 94 行定义.

◆ IsLevelMsgBox()

bool dl::LogSystem::IsLevelMsgBox ( Level level)
inline

检查等级是否可以弹窗(小于等于自己)

在文件 dl_log.h 第 103 行定义.

◆ Level2String()

static std::string_view dl::LogSystem::Level2String ( Level level)
inlinestatic

日志等级转字符串

在文件 dl_log.h 第 149 行定义.

◆ Pop()

void dl::LogSystem::Pop ( )
inline

出栈设置

在文件 dl_log.h 第 138 行定义.

◆ PopLevelLimit()

void dl::LogSystem::PopLevelLimit ( )
inline

在文件 dl_log.h 第 89 行定义.

◆ Push()

void dl::LogSystem::Push ( const Setting & setting)
inline

入栈设置

参数
[in]setting设置
注解
必须调用Pop出栈设置

在文件 dl_log.h 第 119 行定义.

◆ PushLevel()

void dl::LogSystem::PushLevel ( Level level)
inline

入栈设置

参数
[in]level等级
注解
必须调用Pop出栈设置

在文件 dl_log.h 第 130 行定义.

◆ PushLevelLimit()

void dl::LogSystem::PushLevelLimit ( Level level)
inline

设置日志输出等级

参数
[in]level限制等级 大于自己不输出
注解
必须调用PopLevelLimit出栈

在文件 dl_log.h 第 84 行定义.

◆ SetLevelMsgBox()

void dl::LogSystem::SetLevelMsgBox ( Level level)
inline

设置弹窗等级(小于等于自己才弹,越小越严重)

在文件 dl_log.h 第 108 行定义.

◆ SetLogFile()

void dl::LogSystem::SetLogFile ( std::string_view path,
std::string_view name = {} )

设置日志文件路径(非线程安全)

参数
[in]path日志文件夹(为空时不生成)
[in]name日志名(为空时自动取名)
注解
请在Engine::Init后 调用一次

该类的文档由以下文件生成: