dl
dl_log.h 文件参考

日志系统 更多...

#include <string>
#include <iostream>
#include <stack>
#include <array>
#include <mutex>
#include "system/dl_platform.h"
#include <stacktrace>
#include <source_location>
#include <fmt/format.h>

浏览该文件的源代码.

struct  dl::LogSourceLocation
 
class  dl::LogSystem
 日志系统 更多...
 
struct  dl::LogSystem::Setting
 
class  dl::LogLevelSet
 日志打印等级设置 更多...
 
class  dl::LogLimit
 日志打印限制 更多...
 
class  dl::LogStackTrack
 日志打开调用堆栈 更多...
 

命名空间

namespace  dl
 

宏定义

#define DL_SOURCE_LOCATION   std::source_location location = std::source_location::current()
 
#define DL_SOURCE_LOCATION_IMP   std::source_location location
 
#define DL_SOURCE_LOCATION_CALL   std::source_location::current()
 
#define DL_SOURCE_LOCATION_FORWARD   location
 
#define DL_MAKE_SOURCE_LOCATION(loc)
 
#define log_(...)
 
#define log_pause(...)
 
#define log_test(...)
 
#define log_info(...)
 
#define log_msg(...)
 
#define log_notice(...)
 
#define log_warn(...)
 
#define log_err(...)
 
#define log_damage(...)
 

函数

void dl::Output (std::string_view str)
 打印到标准输出、vs、日志文件
 
void dl::log_easy (std::string_view str)
 输出日志
 
void dl::log_pause0 (std::string_view str, DL_SOURCE_LOCATION)
 
void dl::log_test0 (std::string_view str, DL_SOURCE_LOCATION)
 
void dl::log_info0 (std::string_view str, DL_SOURCE_LOCATION)
 
void dl::log_msg0 (std::string_view str, DL_SOURCE_LOCATION)
 
void dl::log_notice0 (std::string_view str, DL_SOURCE_LOCATION)
 
void dl::log_warn0 (std::string_view str, DL_SOURCE_LOCATION)
 
void dl::log_err0 (std::string_view str, DL_SOURCE_LOCATION)
 
void dl::log_damage0 (std::string_view str, DL_SOURCE_LOCATION)
 
void dl::log (std::string_view str, DL_SOURCE_LOCATION)
 以当前设置输出
 
void dl::log_err0 (const std::exception &e, DL_SOURCE_LOCATION)
 特殊类型输出
 
void dl::log_err0 (const std::system_error &e, DL_SOURCE_LOCATION)
 

变量

constexpr std::array< std::string_view, 9 > dl::DL_LOG_SYSTEM_LEVLE_NAME
 
LogSystemdl::g_log
 

详细描述

日志系统

版本
1.0
作者
lveyou
日期
23-06-22
注解

在文件 dl_log.h 中定义.

宏定义说明

◆ DL_MAKE_SOURCE_LOCATION

#define DL_MAKE_SOURCE_LOCATION ( loc)
值:
LogSourceLocation loc;\
loc._file = location.file_name();\
loc._func = location.function_name();\
loc._line = location.line();\
loc._column = location.column();

在文件 dl_log.h48 行定义.

◆ DL_SOURCE_LOCATION

#define DL_SOURCE_LOCATION   std::source_location location = std::source_location::current()

在文件 dl_log.h25 行定义.

◆ DL_SOURCE_LOCATION_CALL

#define DL_SOURCE_LOCATION_CALL   std::source_location::current()

在文件 dl_log.h27 行定义.

◆ DL_SOURCE_LOCATION_FORWARD

#define DL_SOURCE_LOCATION_FORWARD   location

在文件 dl_log.h28 行定义.

◆ DL_SOURCE_LOCATION_IMP

#define DL_SOURCE_LOCATION_IMP   std::source_location location

在文件 dl_log.h26 行定义.

◆ log_

#define log_ ( ...)
值:
log(fmt::format(__VA_ARGS__), DL_SOURCE_LOCATION_CALL)
#define DL_SOURCE_LOCATION_CALL

在文件 dl_log.h277 行定义.

◆ log_damage

#define log_damage ( ...)
值:
log_damage0(fmt::format(__VA_ARGS__), DL_SOURCE_LOCATION_CALL)

在文件 dl_log.h285 行定义.

◆ log_err

#define log_err ( ...)
值:
log_err0(fmt::format(__VA_ARGS__), DL_SOURCE_LOCATION_CALL)

在文件 dl_log.h284 行定义.

◆ log_info

#define log_info ( ...)
值:
log_info0(fmt::format(__VA_ARGS__), DL_SOURCE_LOCATION_CALL)

在文件 dl_log.h280 行定义.

◆ log_msg

#define log_msg ( ...)
值:
log_msg0(fmt::format(__VA_ARGS__), DL_SOURCE_LOCATION_CALL)

在文件 dl_log.h281 行定义.

◆ log_notice

#define log_notice ( ...)
值:
log_notice0(fmt::format(__VA_ARGS__), DL_SOURCE_LOCATION_CALL)

在文件 dl_log.h282 行定义.

◆ log_pause

#define log_pause ( ...)
值:
log_pause0(fmt::format(__VA_ARGS__), DL_SOURCE_LOCATION_CALL)

在文件 dl_log.h278 行定义.

◆ log_test

#define log_test ( ...)
值:
log_test0(fmt::format(__VA_ARGS__), DL_SOURCE_LOCATION_CALL)

在文件 dl_log.h279 行定义.

◆ log_warn

#define log_warn ( ...)
值:
log_warn0(fmt::format(__VA_ARGS__), DL_SOURCE_LOCATION_CALL)

在文件 dl_log.h283 行定义.