LoggerLevel Class Reference

A bit-field class for identifying logger message types. More...

#include <logger_level.hpp>

List of all members.

Public Member Functions

 LoggerLevel ()
 Default constructor produces a mask that accepts nothing.
 LoggerLevel (unsigned l, unsigned s)
 Construct from level and source bitmasks.
const LoggerLevel operator| (LoggerLevel const &rhs) const
 Bitwise OR operator.
const LoggerLevel operator & (LoggerLevel const &rhs) const
 Bitwise AND operator.
 operator bool () const
 Implicit conversion to boolean.


Detailed Description

A bit-field class for identifying logger message types.

For now, you can specify message "level" (e.g. Warning versus Debug messages) flags and message "source" (where a message originates) flags. These flag sets occupy exclusive portions of the bit-field, so they are combined using the bitwise-and operator (&). Flags from the same set can be combined using the bitwise-or operator (|). For example, here is one correct (if verbose) way to specify a mask for all messages from the container framework:

LoggerLevel l = CONTAINERS & ALL_LEVELS;

or, if you wanted to capture warning or error messages from everything:

LoggerLevel l = (ERROR | WARNING) & ALL_SOURCES;

Of course, in these cases, it would be sufficient to omit the ALL_LEVELS and ALL_SOURCES flags, because these are implicit -- all of the message level flags imply an acceptance of all sources, and vice-versa. A more complicated example might look like this:

LoggerLevel l = (ERROR | WARNING) & (ATOMS | CONTAINERS);

which would accept all error and warning messages from the atom and container frameworks.


Constructor & Destructor Documentation

LoggerLevel (  ) 

Default constructor produces a mask that accepts nothing.

LoggerLevel ( unsigned  l,
unsigned  s 
)

Construct from level and source bitmasks.


Member Function Documentation

const LoggerLevel operator| ( LoggerLevel const &  rhs  )  const

Bitwise OR operator.

const LoggerLevel operator & ( LoggerLevel const &  rhs  )  const

Bitwise AND operator.

operator bool (  )  const

Implicit conversion to boolean.


The documentation for this class was generated from the following file:
Generated on Sun Jul 15 20:46:37 2007 for BTK Core by  doxygen 1.5.1