Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
StderrLogger Class Reference

Stderr Logger. More...

#include <ored/utilities/log.hpp>

+ Inheritance diagram for StderrLogger:
+ Collaboration diagram for StderrLogger:

Public Member Functions

 StderrLogger (bool alertOnly=false)
 Constructor. More...
 
virtual ~StderrLogger ()
 Destructor. More...
 
virtual void log (unsigned l, const std::string &s) override
 The log callback that writes to stderr. More...
 
- Public Member Functions inherited from Logger
virtual ~Logger ()
 Destructor. More...
 
virtual void log (unsigned level, const std::string &s)=0
 The Log call back function. More...
 
const std::string & name ()
 Returns the Logger name. More...
 

Static Public Attributes

static const std::string name = "StderrLogger"
 the name "StderrLogger" More...
 

Private Attributes

bool alertOnly_
 

Additional Inherited Members

- Protected Member Functions inherited from Logger
 Logger (const std::string &name)
 Constructor. More...
 

Detailed Description

Stderr Logger.

This logger writes each log message out to stderr (std::cerr)

See also
Log

Definition at line 164 of file log.hpp.

Constructor & Destructor Documentation

◆ StderrLogger()

StderrLogger ( bool  alertOnly = false)

Constructor.

This logger writes all logs to stderr. If alertOnly is set to true, it will only write alerts.

Definition at line 173 of file log.hpp.

173: Logger(name), alertOnly_(alertOnly) {}
Logger(const std::string &name)
Constructor.
Definition: log.hpp:152
static const std::string name
the name "StderrLogger"
Definition: log.hpp:167

◆ ~StderrLogger()

virtual ~StderrLogger ( )
virtual

Destructor.

Definition at line 175 of file log.hpp.

175{}

Member Function Documentation

◆ log()

virtual void log ( unsigned  l,
const std::string &  s 
)
overridevirtual

The log callback that writes to stderr.

Implements Logger.

Definition at line 177 of file log.hpp.

177 {
178 if (!alertOnly_ || l == ORE_ALERT)
179 std::cerr << s << std::endl;
180 }
#define ORE_ALERT
Definition: log.hpp:27

Member Data Documentation

◆ name

const string name = "StderrLogger"
static

the name "StderrLogger"

Definition at line 167 of file log.hpp.

◆ alertOnly_

bool alertOnly_
private

Definition at line 183 of file log.hpp.