opendnp3  3.1.0
Reference implementation of DNP3 (IEEE-1815)
opendnp3::Logger Class Reference

A copyable facade over a LogRoot class. More...

#include <opendnp3/logging/Logger.h>

Classes

struct  Settings
 

Public Member Functions

 Logger (const std::shared_ptr< ILogHandler > &backend, ModuleId moduleid, const std::string &id, LogLevels levels)
 
Logger detach (const std::string &id) const
 
Logger detach (const std::string &id, LogLevels levels) const
 
Logger detach (LogLevels levels) const
 
LogLevels get_levels () const
 
bool is_enabled (const LogLevel &level) const
 
void log (const LogLevel &level, const char *location, const char *message)
 
void rename (const std::string &id)
 
void set_levels (const LogLevels &filters)
 

Static Public Member Functions

static Logger empty ()
 

Private Member Functions

 Logger ()=delete
 
 Logger (const std::shared_ptr< ILogHandler > &backend, const std::shared_ptr< Settings > &settings)
 
Loggeroperator= (const Logger &)=delete
 

Private Attributes

const std::shared_ptr< ILogHandlerbackend
 
const std::shared_ptr< Settingssettings
 

Detailed Description

A copyable facade over a LogRoot class.

Definition at line 36 of file Logger.h.

Constructor & Destructor Documentation

◆ Logger() [1/3]

opendnp3::Logger::Logger ( const std::shared_ptr< ILogHandler > &  backend,
ModuleId  moduleid,
const std::string &  id,
LogLevels  levels 
)
inline

Definition at line 48 of file Logger.h.

◆ Logger() [2/3]

opendnp3::Logger::Logger ( const std::shared_ptr< ILogHandler > &  backend,
const std::shared_ptr< Settings > &  settings 
)
inlineprivate

Definition at line 102 of file Logger.h.

◆ Logger() [3/3]

opendnp3::Logger::Logger ( )
privatedelete

Referenced by detach(), and empty().

Member Function Documentation

◆ detach() [1/3]

Logger opendnp3::Logger::detach ( const std::string &  id) const
inline

Definition at line 66 of file Logger.h.

References backend, Logger(), and settings.

◆ detach() [2/3]

Logger opendnp3::Logger::detach ( const std::string &  id,
LogLevels  levels 
) const
inline

Definition at line 71 of file Logger.h.

References backend, Logger(), and settings.

◆ detach() [3/3]

Logger opendnp3::Logger::detach ( LogLevels  levels) const
inline

Definition at line 76 of file Logger.h.

References backend, Logger(), and settings.

◆ empty()

static Logger opendnp3::Logger::empty ( )
inlinestatic

Definition at line 53 of file Logger.h.

References Logger().

◆ get_levels()

LogLevels opendnp3::Logger::get_levels ( ) const
inline

Definition at line 86 of file Logger.h.

References settings.

◆ is_enabled()

bool opendnp3::Logger::is_enabled ( const LogLevel level) const
inline

Definition at line 81 of file Logger.h.

References backend, and settings.

◆ log()

void opendnp3::Logger::log ( const LogLevel level,
const char *  location,
const char *  message 
)
inline

Definition at line 58 of file Logger.h.

References backend, and settings.

◆ operator=()

Logger& opendnp3::Logger::operator= ( const Logger )
privatedelete

◆ rename()

void opendnp3::Logger::rename ( const std::string &  id)
inline

Definition at line 96 of file Logger.h.

References settings.

◆ set_levels()

void opendnp3::Logger::set_levels ( const LogLevels filters)
inline

Definition at line 91 of file Logger.h.

References settings.

Member Data Documentation

◆ backend

const std::shared_ptr<ILogHandler> opendnp3::Logger::backend
private

Definition at line 110 of file Logger.h.

Referenced by detach(), is_enabled(), and log().

◆ settings

const std::shared_ptr<Settings> opendnp3::Logger::settings
private

Definition at line 111 of file Logger.h.

Referenced by detach(), get_levels(), is_enabled(), log(), rename(), and set_levels().


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