CppLogging  1.0.4.0
C++ Logging Library
Public Member Functions | Static Public Member Functions | List of all members
CppLogging::Config Class Reference

Logger configuration static class. More...

#include <config.h>

Public Member Functions

 Config (const Config &)=delete
 
 Config (Config &&)=delete
 
 ~Config ()
 
Configoperator= (const Config &)=delete
 
Configoperator= (Config &&)=delete
 

Static Public Member Functions

static void ConfigLogger (const std::shared_ptr< Processor > &sink)
 Configure default logger with a given logging sink processor. More...
 
static void ConfigLogger (const std::string &name, const std::shared_ptr< Processor > &sink)
 Configure named logger with a given logging sink processor. More...
 
static Logger CreateLogger ()
 Create default logger. More...
 
static Logger CreateLogger (const std::string &name)
 Create named logger. More...
 
static void Startup ()
 Startup the logging infrastructure. More...
 
static void Shutdown ()
 Shutdown the logging infrastructure. More...
 

Detailed Description

Logger configuration static class.

Logger configuration provides static interface to configure loggers.

Thread-safe.

Definition at line 24 of file config.h.

Constructor & Destructor Documentation

◆ Config() [1/2]

CppLogging::Config::Config ( const Config )
delete

◆ Config() [2/2]

CppLogging::Config::Config ( Config &&  )
delete

◆ ~Config()

CppLogging::Config::~Config ( )

Definition at line 13 of file config.cpp.

Member Function Documentation

◆ ConfigLogger() [1/2]

void CppLogging::Config::ConfigLogger ( const std::shared_ptr< Processor > &  sink)
static

Configure default logger with a given logging sink processor.

Parameters
sink- Logging sink processor
Examples
async.cpp, console.cpp, file.cpp, sync.cpp, and syslog.cpp.

Definition at line 19 of file config.cpp.

◆ ConfigLogger() [2/2]

void CppLogging::Config::ConfigLogger ( const std::string &  name,
const std::shared_ptr< Processor > &  sink 
)
static

Configure named logger with a given logging sink processor.

Parameters
name- Logger name
sink- Logging sink processor

Definition at line 28 of file config.cpp.

◆ CreateLogger() [1/2]

Logger CppLogging::Config::CreateLogger ( )
static

Create default logger.

If the default logger was not configured before it will be automatically configured to a one with TextLayout and ConsoleAppender.

Returns
Created instance of the default logger

Definition at line 37 of file config.cpp.

◆ CreateLogger() [2/2]

Logger CppLogging::Config::CreateLogger ( const std::string &  name)
static

Create named logger.

If the named logger was not configured before an instance of the default logger will be returned.

Parameters
name- Logger name
Returns
Created instance of the named logger

Definition at line 55 of file config.cpp.

◆ operator=() [1/2]

Config& CppLogging::Config::operator= ( Config &&  )
delete

◆ operator=() [2/2]

Config& CppLogging::Config::operator= ( const Config )
delete

◆ Shutdown()

void CppLogging::Config::Shutdown ( )
static

Shutdown the logging infrastructure.

Definition at line 86 of file config.cpp.

◆ Startup()

void CppLogging::Config::Startup ( )
static

Startup the logging infrastructure.

Examples
async.cpp, console.cpp, file.cpp, sync.cpp, and syslog.cpp.

Definition at line 68 of file config.cpp.


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