spdlog
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
spdlog::sinks::test_sink< Mutex > Class Template Reference

Detailed Description

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

Definition at line 19 of file test_sink.h.

#include <test_sink.h>

Inheritance diagram for spdlog::sinks::test_sink< Mutex >:
[legend]

Public Member Functions

size_t msg_counter ()
 
size_t flush_counter ()
 
void set_delay (std::chrono::milliseconds delay)
 
std::vector< std::stringlines ()
 
void log (const details::log_msg &msg) final
 
void flush () final
 
void set_pattern (const std::string &pattern) final
 
void set_formatter (std::unique_ptr< spdlog::formatter > sink_formatter) final
 
void set_level (level::level_enum log_level)
 
level::level_enum level () const
 
bool should_log (level::level_enum msg_level) const
 

Protected Member Functions

void sink_it_ (const details::log_msg &msg) override
 
void flush_ () override
 
virtual void set_pattern_ (const std::string &pattern)
 
virtual void set_formatter_ (std::unique_ptr< spdlog::formatter > sink_formatter)
 

Protected Attributes

size_t msg_counter_ {0}
 
size_t flush_counter_ {0}
 
std::chrono::milliseconds delay_ {std::chrono::milliseconds::zero()}
 
std::vector< std::stringlines_
 
std::unique_ptr< spdlog::formatterformatter_
 
Mutex mutex_
 
level_t level_ {level::trace}
 

Private Attributes

const size_t lines_to_save = 100
 

Member Function Documentation

◆ flush()

template<typename Mutex >
void SPDLOG_INLINE spdlog::sinks::base_sink< Mutex >::flush ( )
finalvirtualinherited

Implements spdlog::sinks::sink.

Definition at line 33 of file base_sink-inl.h.

◆ flush_()

template<class Mutex >
void spdlog::sinks::test_sink< Mutex >::flush_ ( )
inlineoverrideprotectedvirtual

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

Definition at line 64 of file test_sink.h.

◆ flush_counter()

template<class Mutex >
size_t spdlog::sinks::test_sink< Mutex >::flush_counter ( )
inline

Definition at line 30 of file test_sink.h.

◆ level()

SPDLOG_INLINE spdlog::level::level_enum spdlog::sinks::sink::level ( ) const
inherited

Definition at line 22 of file sink-inl.h.

◆ lines()

template<class Mutex >
std::vector< std::string > spdlog::sinks::test_sink< Mutex >::lines ( )
inline

Definition at line 43 of file test_sink.h.

◆ log()

template<typename Mutex >
void SPDLOG_INLINE spdlog::sinks::base_sink< Mutex >::log ( const details::log_msg msg)
finalvirtualinherited

Implements spdlog::sinks::sink.

Definition at line 26 of file base_sink-inl.h.

◆ msg_counter()

template<class Mutex >
size_t spdlog::sinks::test_sink< Mutex >::msg_counter ( )
inline

Definition at line 24 of file test_sink.h.

◆ set_delay()

template<class Mutex >
void spdlog::sinks::test_sink< Mutex >::set_delay ( std::chrono::milliseconds  delay)
inline

Definition at line 36 of file test_sink.h.

◆ set_formatter()

template<typename Mutex >
void SPDLOG_INLINE spdlog::sinks::base_sink< Mutex >::set_formatter ( std::unique_ptr< spdlog::formatter sink_formatter)
finalvirtualinherited

Implements spdlog::sinks::sink.

Definition at line 47 of file base_sink-inl.h.

◆ set_formatter_()

template<typename Mutex >
void SPDLOG_INLINE spdlog::sinks::base_sink< Mutex >::set_formatter_ ( std::unique_ptr< spdlog::formatter sink_formatter)
protectedvirtualinherited

Reimplemented in spdlog::sinks::dist_sink< Mutex >.

Definition at line 60 of file base_sink-inl.h.

◆ set_level()

SPDLOG_INLINE void spdlog::sinks::sink::set_level ( level::level_enum  log_level)
inherited

Definition at line 17 of file sink-inl.h.

◆ set_pattern()

template<typename Mutex >
void SPDLOG_INLINE spdlog::sinks::base_sink< Mutex >::set_pattern ( const std::string pattern)
finalvirtualinherited

Implements spdlog::sinks::sink.

Definition at line 40 of file base_sink-inl.h.

◆ set_pattern_()

template<typename Mutex >
void SPDLOG_INLINE spdlog::sinks::base_sink< Mutex >::set_pattern_ ( const std::string pattern)
protectedvirtualinherited

Reimplemented in spdlog::sinks::dist_sink< Mutex >.

Definition at line 54 of file base_sink-inl.h.

◆ should_log()

SPDLOG_INLINE bool spdlog::sinks::sink::should_log ( level::level_enum  msg_level) const
inherited

Definition at line 12 of file sink-inl.h.

◆ sink_it_()

template<class Mutex >
void spdlog::sinks::test_sink< Mutex >::sink_it_ ( const details::log_msg msg)
inlineoverrideprotectedvirtual

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

Definition at line 50 of file test_sink.h.

Member Data Documentation

◆ delay_

template<class Mutex >
std::chrono::milliseconds spdlog::sinks::test_sink< Mutex >::delay_ {std::chrono::milliseconds::zero()}
protected

Definition at line 71 of file test_sink.h.

◆ flush_counter_

template<class Mutex >
size_t spdlog::sinks::test_sink< Mutex >::flush_counter_ {0}
protected

Definition at line 70 of file test_sink.h.

◆ formatter_

template<typename Mutex >
std::unique_ptr<spdlog::formatter> spdlog::sinks::base_sink< Mutex >::formatter_
protectedinherited

Definition at line 39 of file base_sink.h.

◆ level_

level_t spdlog::sinks::sink::level_ {level::trace}
protectedinherited

Definition at line 27 of file sink.h.

◆ lines_

template<class Mutex >
std::vector<std::string> spdlog::sinks::test_sink< Mutex >::lines_
protected

Definition at line 72 of file test_sink.h.

◆ lines_to_save

template<class Mutex >
const size_t spdlog::sinks::test_sink< Mutex >::lines_to_save = 100
private

Definition at line 21 of file test_sink.h.

◆ msg_counter_

template<class Mutex >
size_t spdlog::sinks::test_sink< Mutex >::msg_counter_ {0}
protected

Definition at line 69 of file test_sink.h.

◆ mutex_

template<typename Mutex >
Mutex spdlog::sinks::base_sink< Mutex >::mutex_
mutableprotectedinherited

Definition at line 40 of file base_sink.h.


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