namespace StatusMsgs

Namespace for Status Messages such as Logs and Errors. More...

List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Public Members


Detailed Description

Namespace for status messages such as for logging and errors. This namespace also keeps all the default definitions and helper functions dealing with the status message classes.

See also: StatusMsg, Log, Error

enum LogLevel {NONE = 0, LOW = 1, MED = 2, HIGH = 3}

Enumeration for keeping track of a log's priority level. This enum has two functions:

The first is selecting what types of logs are displayed. This is set by a Log::Log constructor or the Log::setLogLevel method.

 NONE: Will not display log messages.
 LOW : Will display all log messages expect NONE (LOW, MED, & HIGH).
 MED : Will display log messages with more detail (MED & HIGH).
 HIGH: Will display only the essential log messages (HIGH).

The second is to assign a priority level to a log message. This is set by the Log::operator() method.

 NONE: Log message will not be displayed (making it useless).
 LOW : Log message is of little value.  It is more for tracing through
       the program internally (useful mostly for developers).
 MED : Log message represents more detail compared to HIGH level log
       messages such as pointing out some potential problems.
 HIGH: Log message is of great importance by pointing out major operations.

enum ErrLevel {SUCCESS = 0, MINOR = 1, MAJOR = 2, CRITICAL = 3}

Enumeration for keeping track of an error's severity level.

 SUCCESS : No errors were recorded which is the default state.
 MINOR   : Error is of something that can possible happen but is not desired.
           No error message is displayed and program execution continues on.
 MAJOR   : Error is of something that is not suppose to happen but should not
           cripple the program. So the error message is displayed and program
           execution continues on.
 CRITICAL: Error is of something that should not happen at all and program
           execution will terminate immediately.

const short SM_HDRSZ

Default header size: [5]

const short SM_BODYSZ

Default message body size: [38]

const char SM_DIVIDER[]

Default divider between message body and header: [" "]

const char SM_BORDER[]

Default message header border: ["|"]

const char SM_ERR_BORDER[]

Default message header boarder for errors: ["="]

const char SM_DBODY[]

Default message body: ["<Default Message>"]

const char SM_MESSAGE[]

Default header for status messages: ["MSG"]

const char SM_LOG[]

Default header for log messages: ["LOG"]

const char SM_ERROR[]

Default header for error messages: ["ERROR"]

const char SM_LBRACK[]

Default left bracket used for message arguments: ["["]

const char SM_RBRACK[]

Default right bracket used for message arguments: ["]"]

const char SM_NULL[]

String to represent a NULL string: [""]

StatusMsg (class)

This base class is responsible for storing, handling, and printing status messages which consists of a header and message body. This primarily helps in simplifying the task of displaying system messages to the user and/or developer.

To make the output formating of all status messages work together, global variables were created to handle the message header and body sizes. Therefore when one of these change, it effects all status messages which use the StatusMsg base class.

See also: Log, Error

Log (class)

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

Error (class)

The Error class is a superset of StatusMsg responsible for handling error messages which can have different levels of severity. This class gives an easy object oriented way of handling errors within a program and is found to be much easier to deal with compared to exceptions.

Chances are all error messages within a program will want to be directed to one particular output and have the same header, therefore the Error ostream and error message header has been defined as global. This allows for the ability to easily redefine the location of error outputs for all Error objects with just one method call to setOutput .

see StatusMsgs::ErrLevel

bool  operator== (ErrLevel, ErrLevel)

Helper function to allow compares between error levels.

see ErrLevel


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