LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Member Functions | List of all members
lsst::pex::logging::LogFormatter Class Referenceabstract

an abstract class for formatting log records into a text stream. More...

#include <LogFormatter.h>

Inheritance diagram for lsst::pex::logging::LogFormatter:
lsst::pex::logging::BriefFormatter lsst::pex::logging::NetLoggerFormatter lsst::pex::logging::IndentedFormatter

Public Member Functions

 LogFormatter ()
 
 LogFormatter (const LogFormatter &that)
 
virtual ~LogFormatter ()
 
LogFormatteroperator= (const LogFormatter &that)
 
virtual void write (std::ostream *strm, const LogRecord &rec)=0
 

Detailed Description

an abstract class for formatting log records into a text stream.

Implementations of this class actually write log messages to a stream in a particular format. The messages come in as LogRecord objects, which stores its data in a PropertySet object. The formatter can expect certain properties to be given specific names. The following are standard names:

Name type meaning LOG string the name of the Log producing the message COMMENT string a simple text message TIMESTAMP DateTime the timestamp when the message was recorded DATE string the value of TIMESTAMP in ISO format HOST string the hostname of the machine IP string the IP address of the host PID int the process id of the application NODE int a logical node id in a multi-process application

Only LOG is guaranteed to appear. There may be multiple COMMENT properties, each with a complete thought. All other standard names should only have one value associated with it. If there are multiple values, only the last one should be considered valid.

Definition at line 73 of file LogFormatter.h.

Constructor & Destructor Documentation

lsst::pex::logging::LogFormatter::LogFormatter ( )
inline

create a base LogFormatter

Definition at line 79 of file LogFormatter.h.

79 { }
lsst::pex::logging::LogFormatter::LogFormatter ( const LogFormatter that)
inline

create a copy of a LogFormatter

Definition at line 84 of file LogFormatter.h.

84 { }
virtual lsst::pex::logging::LogFormatter::~LogFormatter ( )
virtual

delete the formatter

Member Function Documentation

LogFormatter& lsst::pex::logging::LogFormatter::operator= ( const LogFormatter that)
inline

copy another formatter into this one

Definition at line 94 of file LogFormatter.h.

94 { return *this; }
virtual void lsst::pex::logging::LogFormatter::write ( std::ostream *  strm,
const LogRecord rec 
)
pure virtual

write out a log record to a stream

Parameters
strmpointer to the output stream to write the record to. If the pointer is null, nothing is written.
recthe record to write

Implemented in lsst::pex::logging::NetLoggerFormatter, lsst::pex::logging::IndentedFormatter, and lsst::pex::logging::BriefFormatter.


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