cpp-toolbox  0.0.1
A toolbox library for C++
Loading...
Searching...
No Matches
thread_logger.hpp File Reference
#include <atomic>
#include <condition_variable>
#include <map>
#include <mutex>
#include <queue>
#include <sstream>
#include <string>
#include <thread>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <cpp-toolbox/cpp-toolbox_export.hpp>
#include "cpp-toolbox/macro.hpp"
#include "cpp-toolbox/container/concurrent_queue.hpp"
#include "cpp-toolbox/base/object_pool.hpp"
Include dependency graph for thread_logger.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  toolbox::logger::is_container< T, typename >
 检查类型是否为容器的类型特征 / Type trait to check if a type is a container More...
 
struct  toolbox::logger::is_container< T, std::void_t< T::value_type, T::iterator, decltype(std::declval< T >().begin()), decltype(std::declval< T >().end())> >
 
struct  toolbox::logger::has_stream_operator< T >
 检查类型是否具有流插入运算符(<<)的类型特征 / Type trait to check if a type has stream insertion operator (<<) More...
 
struct  toolbox::logger::has_ostream_method< T >
 检查类型是否具有ostream方法的类型特征 / Type trait to check if a type has an ostream method More...
 
class  toolbox::logger::thread_logger_t
 具有多个日志级别和格式的线程安全日志类 / Thread-safe logging class with multiple logging levels and formats More...
 
class  toolbox::logger::thread_logger_t::thread_format_logger_t
 基于格式的日志记录器,用于printf风格的消息格式化 / Format-based logger for printf-style message formatting More...
 
class  toolbox::logger::thread_logger_t::thread_stream_logger_t
 用于格式化输出的线程安全流式日志记录器类 / Thread-safe stream logger class for formatted output More...
 

Namespaces

namespace  toolbox
 
namespace  toolbox::logger
 

Macros

#define LOG_TRACE_F   toolbox::logger::thread_logger_t::instance().trace_f()
 TRACE级别格式化日志的宏 / Macro for TRACE level format logging.
 
#define LOG_DEBUG_F   toolbox::logger::thread_logger_t::instance().debug_f()
 DEBUG级别格式化日志的宏 / Macro for DEBUG level format logging.
 
#define LOG_INFO_F   toolbox::logger::thread_logger_t::instance().info_f()
 INFO级别格式化日志的宏 / Macro for INFO level format logging.
 
#define LOG_WARN_F   toolbox::logger::thread_logger_t::instance().warn_f()
 WARN级别格式化日志的宏 / Macro for WARN level format logging.
 
#define LOG_ERROR_F   toolbox::logger::thread_logger_t::instance().error_f()
 ERROR级别格式化日志的宏 / Macro for ERROR level format logging.
 
#define LOG_CRITICAL_F   toolbox::logger::thread_logger_t::instance().critical_f()
 CRITICAL级别格式化日志的宏 / Macro for CRITICAL level format logging.
 
#define LOG_TRACE_S   toolbox::logger::thread_logger_t::instance().trace_s()
 TRACE级别流式日志的宏 / Macro for TRACE level stream logging.
 
#define LOG_DEBUG_S   toolbox::logger::thread_logger_t::instance().debug_s()
 DEBUG级别流式日志的宏 / Macro for DEBUG level stream logging.
 
#define LOG_INFO_S   toolbox::logger::thread_logger_t::instance().info_s()
 INFO级别流式日志的宏 / Macro for INFO level stream logging.
 
#define LOG_WARN_S   toolbox::logger::thread_logger_t::instance().warn_s()
 WARN级别流式日志的宏 / Macro for WARN level stream logging.
 
#define LOG_ERROR_S   toolbox::logger::thread_logger_t::instance().error_s()
 ERROR级别流式日志的宏 / Macro for ERROR level stream logging.
 
#define LOG_CRITICAL_S   toolbox::logger::thread_logger_t::instance().critical_s()
 CRITICAL级别流式日志的宏 / Macro for CRITICAL level stream logging.
 
#define LOG_DEBUG_D(x)
 带源代码位置的DEBUG级别日志的宏 / Macro for DEBUG level logging with source location
 
#define LOG_INFO_D(x)
 带源代码位置的INFO级别日志的宏 / Macro for INFO level logging with source location
 
#define LOG_WARN_D(x)
 带源代码位置的WARN级别日志的宏 / Macro for WARN level logging with source location
 
#define LOG_ERROR_D(x)
 带源代码位置的ERROR级别日志的宏 / Macro for ERROR level logging with source location
 
#define LOG_CRITICAL_D(x)
 带源代码位置的CRITICAL级别日志的宏 / Macro for CRITICAL level logging with source location
 

Variables

template<typename T >
constexpr bool toolbox::logger::is_container_v = is_container<T>::value
 is_container特征的辅助变量模板 / Helper variable template for is_container trait
 
template<typename T >
constexpr bool toolbox::logger::has_stream_operator_v = has_stream_operator<T>::value
 has_stream_operator特征的辅助变量模板 / Helper variable template for has_stream_operator trait
 
template<typename T >
constexpr bool toolbox::logger::has_ostream_method_v = has_ostream_method<T>::value
 has_ostream_method特征的辅助变量模板 / Helper variable template for has_ostream_method trait