Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
spdlog::sinks::ansicolor_sink< Mutex > Class Template Reference

#include <ansicolor_sink.h>

+ Inheritance diagram for spdlog::sinks::ansicolor_sink< Mutex >:
+ Collaboration diagram for spdlog::sinks::ansicolor_sink< Mutex >:

Public Member Functions

 ansicolor_sink (FILE *file)
 
virtual ~ansicolor_sink ()
 
void set_color (level::level_enum color_level, const std::string &color)
 
- Public Member Functions inherited from spdlog::sinks::base_sink< Mutex >
 base_sink ()
 
virtual ~base_sink ()=default
 
 base_sink (const base_sink &)=delete
 
base_sinkoperator= (const base_sink &)=delete
 
void log (const details::log_msg &msg) SPDLOG_FINAL override
 
void flush () SPDLOG_FINAL override
 
- Public Member Functions inherited from spdlog::sinks::sink
 sink ()
 
virtual ~sink ()
 
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[00m"
 Formatting codes.
 
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 grey = "\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_grey = "\033[40m"
 Background colors.
 
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"
 

Protected Member Functions

virtual void _sink_it (const details::log_msg &msg) override
 
void _flush () override
 

Protected Attributes

FILE * target_file_
 
bool should_do_colors_
 
std::map< level::level_enum, std::string > colors_
 
- Protected Attributes inherited from spdlog::sinks::base_sink< Mutex >
Mutex _mutex
 

Detailed Description

template<class Mutex>
class spdlog::sinks::ansicolor_sink< Mutex >

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 26 of file ansicolor_sink.h.

Constructor & Destructor Documentation

◆ ansicolor_sink()

template<class Mutex >
spdlog::sinks::ansicolor_sink< Mutex >::ansicolor_sink ( FILE * file)
inline

Definition at line 29 of file ansicolor_sink.h.

◆ ~ansicolor_sink()

template<class Mutex >
virtual spdlog::sinks::ansicolor_sink< Mutex >::~ansicolor_sink ( )
inlinevirtual

Definition at line 40 of file ansicolor_sink.h.

Member Function Documentation

◆ _flush()

template<class Mutex >
void spdlog::sinks::ansicolor_sink< Mutex >::_flush ( )
inlineoverrideprotectedvirtual

Implements spdlog::sinks::base_sink< Mutex >.

Definition at line 99 of file ansicolor_sink.h.

◆ _sink_it()

template<class Mutex >
virtual void spdlog::sinks::ansicolor_sink< Mutex >::_sink_it ( const details::log_msg & msg)
inlineoverrideprotectedvirtual

Implements spdlog::sinks::base_sink< Mutex >.

Definition at line 81 of file ansicolor_sink.h.

◆ set_color()

template<class Mutex >
void spdlog::sinks::ansicolor_sink< Mutex >::set_color ( level::level_enum color_level,
const std::string & color )
inline

Definition at line 45 of file ansicolor_sink.h.

Member Data Documentation

◆ blink

template<class Mutex >
const std::string spdlog::sinks::ansicolor_sink< Mutex >::blink = "\033[5m"

Definition at line 56 of file ansicolor_sink.h.

◆ blue

template<class Mutex >
const std::string spdlog::sinks::ansicolor_sink< Mutex >::blue = "\033[34m"

Definition at line 65 of file ansicolor_sink.h.

◆ bold

template<class Mutex >
const std::string spdlog::sinks::ansicolor_sink< Mutex >::bold = "\033[1m"

Definition at line 53 of file ansicolor_sink.h.

◆ colors_

template<class Mutex >
std::map<level::level_enum, std::string> spdlog::sinks::ansicolor_sink< Mutex >::colors_
protected

Definition at line 105 of file ansicolor_sink.h.

◆ concealed

template<class Mutex >
const std::string spdlog::sinks::ansicolor_sink< Mutex >::concealed = "\033[8m"

Definition at line 58 of file ansicolor_sink.h.

◆ cyan

template<class Mutex >
const std::string spdlog::sinks::ansicolor_sink< Mutex >::cyan = "\033[36m"

Definition at line 67 of file ansicolor_sink.h.

◆ dark

template<class Mutex >
const std::string spdlog::sinks::ansicolor_sink< Mutex >::dark = "\033[2m"

Definition at line 54 of file ansicolor_sink.h.

◆ green

template<class Mutex >
const std::string spdlog::sinks::ansicolor_sink< Mutex >::green = "\033[32m"

Definition at line 63 of file ansicolor_sink.h.

◆ grey

template<class Mutex >
const std::string spdlog::sinks::ansicolor_sink< Mutex >::grey = "\033[30m"

Definition at line 61 of file ansicolor_sink.h.

◆ magenta

template<class Mutex >
const std::string spdlog::sinks::ansicolor_sink< Mutex >::magenta = "\033[35m"

Definition at line 66 of file ansicolor_sink.h.

◆ on_blue

template<class Mutex >
const std::string spdlog::sinks::ansicolor_sink< Mutex >::on_blue = "\033[44m"

Definition at line 75 of file ansicolor_sink.h.

◆ on_cyan

template<class Mutex >
const std::string spdlog::sinks::ansicolor_sink< Mutex >::on_cyan = "\033[46m"

Definition at line 77 of file ansicolor_sink.h.

◆ on_green

template<class Mutex >
const std::string spdlog::sinks::ansicolor_sink< Mutex >::on_green = "\033[42m"

Definition at line 73 of file ansicolor_sink.h.

◆ on_grey

template<class Mutex >
const std::string spdlog::sinks::ansicolor_sink< Mutex >::on_grey = "\033[40m"

Background colors.

Definition at line 71 of file ansicolor_sink.h.

◆ on_magenta

template<class Mutex >
const std::string spdlog::sinks::ansicolor_sink< Mutex >::on_magenta = "\033[45m"

Definition at line 76 of file ansicolor_sink.h.

◆ on_red

template<class Mutex >
const std::string spdlog::sinks::ansicolor_sink< Mutex >::on_red = "\033[41m"

Definition at line 72 of file ansicolor_sink.h.

◆ on_white

template<class Mutex >
const std::string spdlog::sinks::ansicolor_sink< Mutex >::on_white = "\033[47m"

Definition at line 78 of file ansicolor_sink.h.

◆ on_yellow

template<class Mutex >
const std::string spdlog::sinks::ansicolor_sink< Mutex >::on_yellow = "\033[43m"

Definition at line 74 of file ansicolor_sink.h.

◆ red

template<class Mutex >
const std::string spdlog::sinks::ansicolor_sink< Mutex >::red = "\033[31m"

Definition at line 62 of file ansicolor_sink.h.

◆ reset

template<class Mutex >
const std::string spdlog::sinks::ansicolor_sink< Mutex >::reset = "\033[00m"

Formatting codes.

Definition at line 52 of file ansicolor_sink.h.

◆ reverse

template<class Mutex >
const std::string spdlog::sinks::ansicolor_sink< Mutex >::reverse = "\033[7m"

Definition at line 57 of file ansicolor_sink.h.

◆ should_do_colors_

template<class Mutex >
bool spdlog::sinks::ansicolor_sink< Mutex >::should_do_colors_
protected

Definition at line 104 of file ansicolor_sink.h.

◆ target_file_

template<class Mutex >
FILE* spdlog::sinks::ansicolor_sink< Mutex >::target_file_
protected

Definition at line 103 of file ansicolor_sink.h.

◆ underline

template<class Mutex >
const std::string spdlog::sinks::ansicolor_sink< Mutex >::underline = "\033[4m"

Definition at line 55 of file ansicolor_sink.h.

◆ white

template<class Mutex >
const std::string spdlog::sinks::ansicolor_sink< Mutex >::white = "\033[37m"

Definition at line 68 of file ansicolor_sink.h.

◆ yellow

template<class Mutex >
const std::string spdlog::sinks::ansicolor_sink< Mutex >::yellow = "\033[33m"

Definition at line 64 of file ansicolor_sink.h.


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