Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | List of all members
Log Class Reference

Handler for notifications sent by a Logger. More...

#include <Log.h>

Public Types

typedef unsigned short level_t
 Log verbosity level type.
 
typedef std::map< int, std::string > status_dict_t
 

Public Member Functions

 Log (std::ostream &ostr=std::cerr, int verbosityLevel=LOG_WARNING)
 
 Log (const Log &m)
 
void setOstr (std::ostream &ostr)
 
void setOstr (const std::string &filename)
 
void close ()
 Closes internal ofstr, if used. External ofstream will not be closed.
 
void setVerbosity (level_t level)
 
void setVerbosity (const std::string &level)
 
int getVerbosity () const
 
void flush (level_t level, const std::string &prefix, const std::stringstream &sstr)
 
void flush (level_t level, const Notification &notif, const std::string &prefix, const std::stringstream &sstr)
 
long getRelativeMilliseconds ()
 
void resetTime ()
 

Static Public Member Functions

static long getMilliseconds ()
 

Public Attributes

int id = 0
 

Static Public Attributes

static const status_dict_t statusDict
 
static bool USE_VT100
 

Protected Attributes

std::ostream * ostrPtr
 
std::ofstream ofstr
 
level_t verbosityLevel
 
long millisecondsStart
 

Detailed Description

Handler for notifications sent by a Logger.

debug.setVerbosity(level);
debug.error() << " overflow error, value=" << 5 << '\n';
debug.endl();
debug.error() << " overflow error, value=" << 5 << debug.endl();
Log monitor;
Logger mout(monitor, "FunctionName") ;
Log(std::ostream &ostr=std::cerr, int verbosityLevel=LOG_WARNING)
Definition: Log.h:168

TODO: add direct feed, perhaps Log::error() could instantiate a source?

Constructor & Destructor Documentation

◆ Log()

Log ( std::ostream &  ostr = std::cerr,
int  verbosityLevel = LOG_WARNING 
)
inline
level - verbosity

Member Data Documentation

◆ statusDict

const Log::status_dict_t statusDict
static
Initial value:
= {
{LOG_EMERG, "EMERGENGY"},
{LOG_ERR, "ERROR"},
{LOG_WARNING, "WARNING"},
{LOG_NOTICE, "NOTE"},
{LOG_INFO, "INFO"},
{LOG_DEBUG, "DEBUG"}
}

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