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

LogHandler that prints all log messages to the console. More...

#include <opendnp3/ConsoleLogger.h>

Public Member Functions

 ConsoleLogger (bool printLocation)
 
void log (opendnp3::ModuleId module, const char *id, opendnp3::LogLevel level, char const *location, char const *message) final
 Callback method for log messages. More...
 
- Public Member Functions inherited from opendnp3::ILogHandler
virtual ~ILogHandler ()
 

Static Public Member Functions

static std::shared_ptr< opendnp3::ILogHandlerCreate (bool printLocation=false)
 

Private Attributes

std::mutex mutex
 
bool printLocation
 

Additional Inherited Members

- Private Member Functions inherited from opendnp3::Uncopyable
 Uncopyable ()=default
 
 Uncopyable (Uncopyable &&)=default
 
virtual ~Uncopyable ()=default
 
Uncopyableoperator= (Uncopyable &&)=default
 

Detailed Description

LogHandler that prints all log messages to the console.

Definition at line 35 of file ConsoleLogger.h.

Constructor & Destructor Documentation

◆ ConsoleLogger()

opendnp3::ConsoleLogger::ConsoleLogger ( bool  printLocation)
inline

Definition at line 50 of file ConsoleLogger.h.

Member Function Documentation

◆ Create()

static std::shared_ptr<opendnp3::ILogHandler> opendnp3::ConsoleLogger::Create ( bool  printLocation = false)
inlinestatic

Definition at line 45 of file ConsoleLogger.h.

References printLocation.

◆ log()

void opendnp3::ConsoleLogger::log ( opendnp3::ModuleId  module,
const char *  id,
opendnp3::LogLevel  level,
char const *  location,
char const *  message 
)
finalvirtual

Callback method for log messages.

Parameters
moduleModuleId of the logger
idstring id of the logger
levelbitfield LogLevel of the logger
locationlocation in the source of the log call
messagemessage of the log call

Implements opendnp3::ILogHandler.

Member Data Documentation

◆ mutex

std::mutex opendnp3::ConsoleLogger::mutex
private

Definition at line 55 of file ConsoleLogger.h.

◆ printLocation

bool opendnp3::ConsoleLogger::printLocation
private

Definition at line 53 of file ConsoleLogger.h.

Referenced by Create().


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