class Log

Class For Handling Log Messages. More...

Full nameStatusMsgs::Log
Definition#include <status.H>
InheritsStatusMsgs::StatusMsg [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

This class is a superset of StatusMsg responsible for handling log messages. This class is very helpful in that it allows easy tracking of program execution where log messages can be assigned different levels of importance.

see LogLevel

 Log ()

Set log to default message and to display all log priority levels.

See also: StatusMsgs, StatusMsg

 Log (const string hdr, const LogLevel level = LOW, ostream& ostr = clog)

Set log to default header mainly telling function or location of logging within the program.

Parameters:
hdrHeader
levelDefault log level display setting: All except NONE
ostrDefault ostream to output onto: clog

See also: StatusMsgs, StatusMsg, LogLevel

operator  LogLevel ()

[const]

Parameter passing operator to return the log level for assignments requiring an enum LogLevel value. This is helpful in passing a LogLevel parameter as the object name, such as Log instead of Log.getLogLevel().

see LogLevel

Returns: Current log level

void  operator() (const LogLevel& level, const string msg, const string arg = SM_NULL, ostream& ostr = clog)

This method allows for "log(LogLevel,message)" operations which first performs a check to make sure that the log's message priority level is acceptable related to the level specified by a Log constructor. If it is, then the body message is set and printed.

Parameters:
levelPriority level of log message
msgMain message of log
argMessage argument of log (default: no argument)
ostrostream to output onto. If none specified, then the ostream set by the Log constructor or setOutput method is used. Note that clog ostream will not work as an option to this method.

void  operator() (const LogLevel& level, const string msg, const unsigned char& arg, ostream& ostr = clog)

Same as above but handles an unsigned character for the argument

void  operator() (const LogLevel& level, const string msg, const char& arg, ostream& ostr = clog)

Same as above but handles a character for the argument

void  operator() (const LogLevel& level, const string msg, const unsigned int arg, ostream& ostr = clog)

Same as above but handles an unsigned integer for the argument

void  operator() (const LogLevel& level, const string msg, const int arg, ostream& ostr = clog)

Same as above but handles an integer for the argument

void  operator() (const LogLevel& level, const string msg, const unsigned long arg, ostream& ostr = clog)

Same as above but handles an unsigned long for the argument

void  operator() (const LogLevel& level, const string msg, const long arg, ostream& ostr = clog)

Same as above but handles a long for the argument

void  operator() (const string msg, const long arg, ostream& ostr = clog)

This overload operator is basically the same as the one above except this one is geared more towards lazy people who do not need to specify priority levels of log messages. The default LogLevel is HIGH, so when used in conjunction with the Log constructor with zero arguments, this method will print all logs.

Parameters:
msgMain message of log
argMessage argument of log (default: no argument)
ostrostream to output onto. If none specified, then the ostream set by the Log constructor or setOutput method is used. Note that clog ostream will not work as an option to this method.

void  operator() (const string msg, const unsigned long arg, ostream& ostr = clog)

Same as above but handles an unsigned long for the argument

void  operator() (const string msg, const int arg, ostream& ostr = clog)

Same as above but handles an integer for the argument

void  operator() (const string msg, const unsigned int arg, ostream& ostr = clog)

Same as above but handles an unsigned integer for the argument

void  operator() (const string msg, const char& arg, ostream& ostr = clog)

Same as above but handles a character for the argument

void  operator() (const string msg, const unsigned char& arg, ostream& ostr = clog)

Same as above but handles an unsigned character for the argument

void  operator() (const string msg, const string arg = SM_NULL, ostream& ostr = clog)

Same as above but handles a character string for the argument

void  setLogLevel (const LogLevel level)

This method changes the default log level display setting which is originally set by a Log constructor.

see LogLevel

Parameters:
levelLog level display setting

void  setOutput (ostream& newout)

This method changes the current output ostream.

Parameters:
newoutNew ostream for log's default output

LogLevel  getLogLevel ()

[const]

This method returns the log level display setting which is set by either the Log constructor or setLogLevel method.

see LogLevel

Returns: Current log level


Generated on Fri Mar 9 02:04:42 2001, using kdoc 2.0a43.