Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
sese::record::BlockAppender Class Referencefinal

Block file log appender class. More...

#include <BlockAppender.h>

Inheritance diagram for sese::record::BlockAppender:
sese::record::AbstractAppender

Public Member Functions

 BlockAppender (size_t block_max_size, Level level=Level::DEBUG)
 
 ~BlockAppender () noexcept override
 
void dump (const char *buffer, size_t size) noexcept override
 
- Public Member Functions inherited from sese::record::AbstractAppender
 AbstractAppender () noexcept=default
 
virtual ~AbstractAppender () noexcept=default
 
 AbstractAppender (Level level) noexcept
 
Level getLevel () const noexcept
 
void setLevel (Level lv) noexcept
 

Private Attributes

size_t size = 0
 
std::mutex mutex
 
size_t maxSize = 0
 
io::BufferedStream::Ptr bufferedStream
 
io::FileStream::Ptr fileStream
 

Additional Inherited Members

- Public Types inherited from sese::record::AbstractAppender
typedef std::shared_ptr< AbstractAppenderPtr
 
- Protected Attributes inherited from sese::record::AbstractAppender
Level level = Level::DEBUG
 Output threshold.
 

Detailed Description

Block file log appender class.

Constructor & Destructor Documentation

◆ BlockAppender()

BlockAppender::BlockAppender ( size_t block_max_size,
Level level = Level::DEBUG )
explicit

Initialize block parameters

Parameters
block_max_sizePreset size of the block. This parameter has a minimum value limit in non-DEBUG mode, at least 1000 * 1024, which is 1MB
levelThreshold level

References bufferedStream, sese::io::FileStream::create(), fileStream, getDateTimeString(), maxSize, and sese::io::FileStream::T_WRITE_TRUNC.

◆ ~BlockAppender()

BlockAppender::~BlockAppender ( )
overridenoexcept

References bufferedStream, and fileStream.

Member Function Documentation

◆ dump()

void BlockAppender::dump ( const char * buffer,
size_t size )
overridevirtualnoexcept

Member Data Documentation

◆ bufferedStream

io::BufferedStream::Ptr sese::record::BlockAppender::bufferedStream
private

Referenced by BlockAppender(), and ~BlockAppender().

◆ fileStream

io::FileStream::Ptr sese::record::BlockAppender::fileStream
private

Referenced by BlockAppender(), and ~BlockAppender().

◆ maxSize

size_t sese::record::BlockAppender::maxSize = 0
private

Referenced by BlockAppender().

◆ mutex

std::mutex sese::record::BlockAppender::mutex
private

◆ size

size_t sese::record::BlockAppender::size = 0
private

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