EpcTools
An event based multi-threaded C++ development framework.
Public Member Functions | List of all members
ELoggerSinkRotatingFile Class Reference

A rotating file sink. More...

#include <elogger.h>

Inheritance diagram for ELoggerSinkRotatingFile:
ELoggerSink

Public Member Functions

 ELoggerSinkRotatingFile (ELogger::LogLevel loglevel, cpStr pattern, cpStr filename, size_t maxsizemb, size_t maxfiles, Bool rotateonopen)
 Class constructor. More...
 
virtual ~ELoggerSinkRotatingFile ()
 Class destructor. More...
 
EStringgetFilename ()
 Retrieves the log file name. More...
 
size_t getMaxSizeMB ()
 Retrieves the maximum log file size. More...
 
size_t getMaxFiles ()
 Retrieves the maximum number of files in the rotation. More...
 
Bool getRotateOnOpen ()
 Retrieves the rotate on open setting. More...
 
- Public Member Functions inherited from ELoggerSink
virtual ~ELoggerSink ()
 Class destructor. More...
 
SinkType getSinkType ()
 Retrieves the sink type. More...
 
ELogger::LogLevel getLogLevel ()
 Retrieves the log level for this sink. More...
 
EStringgetPattern ()
 Retrieves the log message formatting pattern. More...
 
ELogger::LogLevel setLogLevel (ELogger::LogLevel loglevel)
 Assigns the sink log level. More...
 
EStringsetPattern (cpStr pattern)
 Assigns the log message formatting pattern. More...
 
spdlog::sink_ptr getSinkPtr ()
 Retrieves the underlying spdlog sink pointer. More...
 

Additional Inherited Members

- Public Types inherited from ELoggerSink
enum  SinkType {
  eSyslog, eStdout, eStderr, eBasicFile,
  eRotatingFile, eDailyFile
}
 Defines the type of output sinks. More...
 
- Static Public Member Functions inherited from ELoggerSink
static EStringgetDefaultPattern ()
 Retrieves the default log message formatting pattern. More...
 
- Protected Member Functions inherited from ELoggerSink
 ELoggerSink (SinkType sinktype, ELogger::LogLevel loglevel, cpStr pattern)
 The base class constructor. More...
 
spdlog::sink_ptr setSinkPtr (spdlog::sink_ptr &sinkptr)
 Assigns the spdlog pointer value. More...
 

Detailed Description

A rotating file sink.

Constructor & Destructor Documentation

◆ ELoggerSinkRotatingFile()

ELoggerSinkRotatingFile::ELoggerSinkRotatingFile ( ELogger::LogLevel  loglevel,
cpStr  pattern,
cpStr  filename,
size_t  maxsizemb,
size_t  maxfiles,
Bool  rotateonopen 
)

Class constructor.

Parameters
loglevelthe sink log level.
patternthe log message formatting pattern.
filenamethe log file name.
maxsizembthe maximum size of a log file in megabytes.
maxfilesthe maximum number of files in the rotation.
rotateonopendetermines if the next file will be written to when the logger is opened.

◆ ~ELoggerSinkRotatingFile()

virtual ELoggerSinkRotatingFile::~ELoggerSinkRotatingFile ( )
inlinevirtual

Class destructor.

Member Function Documentation

◆ getFilename()

EString& ELoggerSinkRotatingFile::getFilename ( )
inline

Retrieves the log file name.

Returns
the log file name.

◆ getMaxFiles()

size_t ELoggerSinkRotatingFile::getMaxFiles ( )
inline

Retrieves the maximum number of files in the rotation.

Returns
the maximum number of files in the rotation.

◆ getMaxSizeMB()

size_t ELoggerSinkRotatingFile::getMaxSizeMB ( )
inline

Retrieves the maximum log file size.

Returns
the maximum log file size.

◆ getRotateOnOpen()

Bool ELoggerSinkRotatingFile::getRotateOnOpen ( )
inline

Retrieves the rotate on open setting.

Returns
True will cause the next file to be opened (regardless of it's size), otherwise the last file will be written to.

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