ngl_server 1.0
基于 Actor 模型的 C++ 服务器框架
ngl::nactor_logitem Struct Reference

Actor日志构建器。 More...

#include <nactor_logitem.h>

Public Member Functions

 nactor_logitem (ELOGLEVEL alevel=ELOG_NONE)
 nactor_logitem (ELOGLEVEL alevel, ELOG_TYPE alogtype, bool aisnet, const std::source_location &asource=std::source_location::current())
template<typename ... ARGS>
void print (const std::format_string< ARGS... > &aformat, const ARGS &... aargs)
void print (const char *astr)
void print (const std::string &astr)
template<typename T>
nactor_logitem & operator<< (const T &adata)
nactor_logitem & operator<< (std::ostream &(*amanipulator)(std::ostream &))

Static Public Member Functions

static bool check_level (ELOGLEVEL alevel)

Public Attributes

std::stringstream m_stream
ELOGLEVEL m_level
bool m_isnet

Static Public Attributes

static bool m_init = false
 nactor_logitem初始化标志

Detailed Description

Actor日志构建器。

提供流式和格式化两种日志记录方式。支持:

  • 控制台彩色输出(按级别着色)
  • 异步文件日志投递(通过日志Actor)
  • 源文件位置自动捕获(std::source_location)
  • 日志级别过滤
Note
使用print()方法进行格式化日志记录。
使用<<运算符进行流式日志记录。

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