Livox SDK API  V2.2.0
spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex > Class Template Referencefinal

#include <ansicolor_sink.h>

Inheritance diagram for spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >:
spdlog::sinks::sink

Public Types

using mutex_t = typename ConsoleMutex::mutex_t
 

Public Member Functions

 ansicolor_sink ()
 
 ~ansicolor_sink () override=default
 
 ansicolor_sink (const ansicolor_sink &other)=delete
 
ansicolor_sinkoperator= (const ansicolor_sink &other)=delete
 
void set_color (level::level_enum color_level, const std::string &color)
 
void log (const details::log_msg &msg) override
 
void flush () override
 
void set_pattern (const std::string &pattern) final
 
void set_formatter (std::unique_ptr< spdlog::formatter > sink_formatter) override
 
bool should_color ()
 
- Public Member Functions inherited from spdlog::sinks::sink
 sink ()=default
 
 sink (std::unique_ptr< spdlog::formatter > formatter)
 
virtual ~sink ()=default
 
bool should_log (level::level_enum msg_level) const
 
void set_level (level::level_enum log_level)
 
level::level_enum level () const
 

Public Attributes

const std::string reset = "\033[m"
 Formatting codes. More...
 
const std::string bold = "\033[1m"
 
const std::string dark = "\033[2m"
 
const std::string underline = "\033[4m"
 
const std::string blink = "\033[5m"
 
const std::string reverse = "\033[7m"
 
const std::string concealed = "\033[8m"
 
const std::string clear_line = "\033[K"
 
const std::string black = "\033[30m"
 
const std::string red = "\033[31m"
 
const std::string green = "\033[32m"
 
const std::string yellow = "\033[33m"
 
const std::string blue = "\033[34m"
 
const std::string magenta = "\033[35m"
 
const std::string cyan = "\033[36m"
 
const std::string white = "\033[37m"
 
const std::string on_black = "\033[40m"
 Background colors. More...
 
const std::string on_red = "\033[41m"
 
const std::string on_green = "\033[42m"
 
const std::string on_yellow = "\033[43m"
 
const std::string on_blue = "\033[44m"
 
const std::string on_magenta = "\033[45m"
 
const std::string on_cyan = "\033[46m"
 
const std::string on_white = "\033[47m"
 

Additional Inherited Members

- Protected Attributes inherited from spdlog::sinks::sink
level_t level_ {level::trace}
 
std::unique_ptr< spdlog::formatterformatter_ {details::make_unique<spdlog::pattern_formatter>()}
 

Detailed Description

template<typename TargetStream, class ConsoleMutex>
class spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >

This sink prefixes the output with an ANSI escape sequence color code depending on the severity of the message. If no color terminal detected, omit the escape codes.

Definition at line 32 of file ansicolor_sink.h.

Member Typedef Documentation

template<typename TargetStream , class ConsoleMutex >
using spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::mutex_t = typename ConsoleMutex::mutex_t

Definition at line 35 of file ansicolor_sink.h.

Constructor & Destructor Documentation

template<typename TargetStream , class ConsoleMutex >
spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::ansicolor_sink ( )
inline

Definition at line 36 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::~ansicolor_sink ( )
overridedefault
template<typename TargetStream , class ConsoleMutex >
spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::ansicolor_sink ( const ansicolor_sink< TargetStream, ConsoleMutex > &  other)
delete

Member Function Documentation

template<typename TargetStream , class ConsoleMutex >
void spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::flush ( )
inlineoverridevirtual

Implements spdlog::sinks::sink.

Definition at line 118 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
void spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::log ( const details::log_msg msg)
inlineoverridevirtual

Implements spdlog::sinks::sink.

Definition at line 92 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
ansicolor_sink& spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::operator= ( const ansicolor_sink< TargetStream, ConsoleMutex > &  other)
delete
template<typename TargetStream , class ConsoleMutex >
void spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::set_color ( level::level_enum  color_level,
const std::string &  color 
)
inline

Definition at line 56 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
void spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::set_formatter ( std::unique_ptr< spdlog::formatter sink_formatter)
inlineoverridevirtual

Implements spdlog::sinks::sink.

Definition at line 130 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
void spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::set_pattern ( const std::string &  pattern)
inlinefinalvirtual

Implements spdlog::sinks::sink.

Definition at line 124 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
bool spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::should_color ( )
inline

Definition at line 136 of file ansicolor_sink.h.

Member Data Documentation

template<typename TargetStream , class ConsoleMutex >
const std::string spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::black = "\033[30m"

Definition at line 73 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
const std::string spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::blink = "\033[5m"

Definition at line 67 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
const std::string spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::blue = "\033[34m"

Definition at line 77 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
const std::string spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::bold = "\033[1m"

Definition at line 64 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
const std::string spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::clear_line = "\033[K"

Definition at line 70 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
const std::string spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::concealed = "\033[8m"

Definition at line 69 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
const std::string spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::cyan = "\033[36m"

Definition at line 79 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
const std::string spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::dark = "\033[2m"

Definition at line 65 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
const std::string spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::green = "\033[32m"

Definition at line 75 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
const std::string spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::magenta = "\033[35m"

Definition at line 78 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
const std::string spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::on_black = "\033[40m"

Background colors.

Definition at line 83 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
const std::string spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::on_blue = "\033[44m"

Definition at line 87 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
const std::string spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::on_cyan = "\033[46m"

Definition at line 89 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
const std::string spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::on_green = "\033[42m"

Definition at line 85 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
const std::string spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::on_magenta = "\033[45m"

Definition at line 88 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
const std::string spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::on_red = "\033[41m"

Definition at line 84 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
const std::string spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::on_white = "\033[47m"

Definition at line 90 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
const std::string spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::on_yellow = "\033[43m"

Definition at line 86 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
const std::string spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::red = "\033[31m"

Definition at line 74 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
const std::string spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::reset = "\033[m"

Formatting codes.

Definition at line 63 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
const std::string spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::reverse = "\033[7m"

Definition at line 68 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
const std::string spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::underline = "\033[4m"

Definition at line 66 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
const std::string spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::white = "\033[37m"

Definition at line 80 of file ansicolor_sink.h.

template<typename TargetStream , class ConsoleMutex >
const std::string spdlog::sinks::ansicolor_sink< TargetStream, ConsoleMutex >::yellow = "\033[33m"

Definition at line 76 of file ansicolor_sink.h.


The documentation for this class was generated from the following file: