VICI  0.11.815
Visual Chart Interpreter
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Protected Member Functions | List of all members
VICI::cfi::FormattingLogger Class Reference

Class for producing a formatted log message. More...

#include <vici/log.h>

Inheritance diagram for VICI::cfi::FormattingLogger:
VICI::cfi::logger VICI::cfi::FileLogger VICI::cfi::StdLogger VICI::cfi::UDPLogger

Protected Member Functions

std::string timeStamp ()
 generates a string containing the current time More...
 
csr hostname ()
 generates a string containing the hostname.
 
csr process ()
 generates a string containing the process id
 
csr severity (Severity)
 generates a string containing the severity level
 
int format (std::ostream &s, Severity sev, csr msg)
 output the message to the stream More...
 
- Protected Member Functions inherited from VICI::cfi::logger
 logger ()
 Constructor.
 

Additional Inherited Members

- Public Member Functions inherited from VICI::cfi::logger
virtual ~logger ()
 Destructor.
 
virtual int log (Severity sev, csr line)=0
 log to the unnamed log More...
 
virtual int log (csr logName, Severity sev, csr line)=0
 log to the named log More...
 
- Protected Attributes inherited from VICI::cfi::logger
Semaphore sem4
 Mutual exclusion lock.
 

Detailed Description

Class for producing a formatted log message.

Provides a common formatting function for the different loggers. Writes log messages with a time stamp, host name, and process id in addition to the severity and the message.

Member Function Documentation

int FormattingLogger::format ( std::ostream &  s,
Severity  sev,
csr  msg 
)
protected

output the message to the stream

Parameters
sthe log stream to write to
sevthe severity level to use
msgthe message to write to the log
Returns
the number of characters written to the stream
string FormattingLogger::timeStamp ( )
protected

generates a string containing the current time

Returns
current time as a string with format of H:M:S Y-m-d

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