Clipper
clipper::Message Class Reference

Message handler class. More...

#include <clipper_message.h>

Public Member Functions

 Message ()
 null constuctor
 

Static Public Member Functions

static std::ostream & stream ()
 return the current stream
 
static const int & message_level ()
 return the current message level
 
static const int & fatal_level ()
 return the current fatal error level
 
static void set_stream (std::ostream &stream)
 set the output stream
 
static void set_message_level (const int &level)
 set the current message level
 
static void set_fatal_level (const int &level)
 set the current fatal error level
 
template<class T >
static void message (const T &message)
 pass a message
 

Detailed Description

Message handler class.

The message handler is a static class which handles messages and errors. It has 3 properties:

  • the output stream: to which messages will be directed (default stderr)
  • message level: messages with a level >= this will be output (default 5)
  • fatal level: messages with a level >= this will be fatal (default 9)

Levels may be in the range 1-9. They are priorotised as follows:

  • 1-4 messages, never fatal
  • 5-8 warning, may be fatal
  • 9: always fatal. The fatal level must be greater than or equal to the message level, and greater than or equal to 5.

A message is any object which implements the following methods:

const std::string& text() const;
int level() const;

The level method may be static. Messages are usually derived from Message_base.


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