|
ngl_server 1.0
基于 Actor 模型的 C++ 服务器框架
|
日志路由:将日志条目分发到控制台输出和日志actor。 More...
#include "tools/log/nactor_logitem.h"#include "tools/tab/xml/sysconfig.h"#include "tools/tools/tools_time.h"#include "tools/log/logprintf.h"#include "tools/tools.h"#include <source_location>#include <sstream>#include <format>#include <string>#include <vector>#include <list>#include <map>#include <set>Classes | |
| class | ngl::elog_name |
| 日志级别名称工具类。 More... | |
| struct | std::formatter< std::vector< T > > |
| struct | std::formatter< std::list< T > > |
| struct | std::formatter< std::set< T > > |
| struct | std::formatter< std::map< TKEY, TVAL > > |
| struct | std::formatter< std::unordered_map< TKEY, TVAL > > |
| struct | std::formatter< google::protobuf::RepeatedField< T > > |
Macros | |
| #define | Try try |
| 异常处理起始宏。 | |
| #define | Catch |
| 异常处理结束宏。 | |
| #define | mk_formatter(NAME) |
Typedefs | |
| using | ngl::ptr_logitem = std::shared_ptr<nactor_logitem> |
| 日志项共享指针类型别名 | |
Functions | |
| ptr_logitem | ngl::log_debug (const std::source_location &asource) |
| 获取DEBUG级别日志项 | |
| ptr_logitem | ngl::log_debug_net (const std::source_location &asource) |
| 获取DEBUG级别网络日志项 | |
| ptr_logitem | ngl::log_info (const std::source_location &asource) |
| 获取INFO级别日志项 | |
| ptr_logitem | ngl::log_info_net (const std::source_location &asource) |
| 获取INFO级别网络日志项 | |
| ptr_logitem | ngl::log_warn (const std::source_location &asource) |
| 获取WARN级别日志项 | |
| ptr_logitem | ngl::log_warn_net (const std::source_location &asource) |
| 获取WARN级别网络日志项 | |
| ptr_logitem | ngl::log_error (const std::source_location &asource) |
| 获取ERROR级别日志项 | |
| ptr_logitem | ngl::log_error_net (const std::source_location &asource) |
| 获取ERROR级别网络日志项 | |
| ptr_logitem | ngl::log_bi (const std::source_location &asource) |
| 获取BI日志项 | |
日志路由:将日志条目分发到控制台输出和日志actor。
本文件提供了日志系统的入口点和格式化工具,包括:
日志系统支持源代码位置捕获,便于调试和错误追踪。
| #define Catch |
异常处理结束宏。
捕获并记录异常信息,包括:
所有异常都会记录到错误日志中,包含函数名称和异常信息。
| #define mk_formatter | ( | NAME | ) |
| #define Try try |
异常处理起始宏。
标记异常处理块的开始,与Catch宏配对使用。
| ptr_logitem ngl::log_bi | ( | const std::source_location & | asource | ) |
获取BI日志项
获取业务智能日志入口点。
| asource | 源码位置 |
| asource | 源代码位置,默认为当前调用位置 |
| ptr_logitem ngl::log_debug | ( | const std::source_location & | asource | ) |
获取DEBUG级别日志项
获取调试级别日志入口点。
| asource | 源码位置 |
立即捕获源位置,以便最终的actor端格式化器能打印原始调用位置。
| asource | 源代码位置,默认为当前调用位置 |
| ptr_logitem ngl::log_debug_net | ( | const std::source_location & | asource | ) |
获取DEBUG级别网络日志项
获取网络调试级别日志入口点。
| asource | 源码位置 |
| asource | 源代码位置,默认为当前调用位置 |
| ptr_logitem ngl::log_error | ( | const std::source_location & | asource | ) |
获取ERROR级别日志项
获取错误级别日志入口点。
| asource | 源码位置 |
| asource | 源代码位置,默认为当前调用位置 |
| ptr_logitem ngl::log_error_net | ( | const std::source_location & | asource | ) |
获取ERROR级别网络日志项
获取网络错误级别日志入口点。
| asource | 源码位置 |
| asource | 源代码位置,默认为当前调用位置 |
| ptr_logitem ngl::log_info | ( | const std::source_location & | asource | ) |
获取INFO级别日志项
获取信息级别日志入口点。
| asource | 源码位置 |
| asource | 源代码位置,默认为当前调用位置 |
| ptr_logitem ngl::log_info_net | ( | const std::source_location & | asource | ) |
获取INFO级别网络日志项
获取网络信息级别日志入口点。
| asource | 源码位置 |
| asource | 源代码位置,默认为当前调用位置 |
| ptr_logitem ngl::log_warn | ( | const std::source_location & | asource | ) |
获取WARN级别日志项
获取警告级别日志入口点。
| asource | 源码位置 |
| asource | 源代码位置,默认为当前调用位置 |
| ptr_logitem ngl::log_warn_net | ( | const std::source_location & | asource | ) |
获取WARN级别网络日志项
获取网络警告级别日志入口点。
| asource | 源码位置 |
| asource | 源代码位置,默认为当前调用位置 |