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

Detailed Description

template<typename Mutex>
class spdlog::sinks::rotating_file_sink< Mutex >

Definition at line 22 of file rotating_file_sink.h.

#include <rotating_file_sink.h>

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

Public Member Functions

 rotating_file_sink (filename_t base_filename, std::size_t max_size, std::size_t max_files, bool rotate_on_open=false)
 
filename_t filename ()
 
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
 

Static Public Member Functions

static filename_t calc_filename (const filename_t &filename, std::size_t index)
 

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

std::unique_ptr< spdlog::formatterformatter_
 
Mutex mutex_
 
level_t level_ {level::trace}
 

Private Member Functions

void rotate_ ()
 
bool rename_file_ (const filename_t &src_filename, const filename_t &target_filename)
 

Private Attributes

filename_t base_filename_
 
std::size_t max_size_
 
std::size_t max_files_
 
std::size_t current_size_
 
details::file_helper file_helper_
 

Constructor & Destructor Documentation

◆ rotating_file_sink()

template<typename Mutex >
SPDLOG_INLINE spdlog::sinks::rotating_file_sink< Mutex >::rotating_file_sink ( filename_t  base_filename,
std::size_t  max_size,
std::size_t  max_files,
bool  rotate_on_open = false 
)

Definition at line 27 of file rotating_file_sink-inl.h.

Member Function Documentation

◆ calc_filename()

template<typename Mutex >
SPDLOG_INLINE filename_t spdlog::sinks::rotating_file_sink< Mutex >::calc_filename ( const filename_t filename,
std::size_t  index 
)
static

Definition at line 44 of file rotating_file_sink-inl.h.

◆ filename()

template<typename Mutex >
SPDLOG_INLINE filename_t spdlog::sinks::rotating_file_sink< Mutex >::filename ( )

Definition at line 57 of file rotating_file_sink-inl.h.

◆ 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<typename Mutex >
SPDLOG_INLINE void spdlog::sinks::rotating_file_sink< Mutex >::flush_ ( )
overrideprotectedvirtual

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

Definition at line 78 of file rotating_file_sink-inl.h.

◆ level()

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

Definition at line 22 of file sink-inl.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.

◆ rename_file_()

template<typename Mutex >
SPDLOG_INLINE bool spdlog::sinks::rotating_file_sink< Mutex >::rename_file_ ( const filename_t src_filename,
const filename_t target_filename 
)
private

Definition at line 123 of file rotating_file_sink-inl.h.

◆ rotate_()

template<typename Mutex >
SPDLOG_INLINE void spdlog::sinks::rotating_file_sink< Mutex >::rotate_ ( )
private

Definition at line 89 of file rotating_file_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)
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<typename Mutex >
SPDLOG_INLINE void spdlog::sinks::rotating_file_sink< Mutex >::sink_it_ ( const details::log_msg msg)
overrideprotectedvirtual

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

Definition at line 64 of file rotating_file_sink-inl.h.

Member Data Documentation

◆ base_filename_

template<typename Mutex >
filename_t spdlog::sinks::rotating_file_sink< Mutex >::base_filename_
private

Definition at line 45 of file rotating_file_sink.h.

◆ current_size_

template<typename Mutex >
std::size_t spdlog::sinks::rotating_file_sink< Mutex >::current_size_
private

Definition at line 48 of file rotating_file_sink.h.

◆ file_helper_

template<typename Mutex >
details::file_helper spdlog::sinks::rotating_file_sink< Mutex >::file_helper_
private

Definition at line 49 of file rotating_file_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.

◆ max_files_

template<typename Mutex >
std::size_t spdlog::sinks::rotating_file_sink< Mutex >::max_files_
private

Definition at line 47 of file rotating_file_sink.h.

◆ max_size_

template<typename Mutex >
std::size_t spdlog::sinks::rotating_file_sink< Mutex >::max_size_
private

Definition at line 46 of file rotating_file_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 files: