OpenMS::Logger Namespace Reference

Log streams. More...


class  LogStreamBuf
 Stream buffer used by LogStream. More...
class  LogStreamNotifier
class  LogStream
 Log Stream Class. More...

Detailed Description

Log streams.

Logging, filtering, and storing messages. Many programs emit warning messages, error messages, or simply information and remarks to their users. The LogStream class provides a convenient and straight-forward interface to classify these messages according to their importance (via the loglevel), filter and store them in files or write them to streams.

As the LogStream class is derived from ostream, it behaves as any ostream object. Additionally you may associate streams with each LogStream object that catch only messages of certain loglevels. So the user might decide to redirect all error messages to cerr, all warning messages to cout and all information to a file.
Along with each message its time of creation and its loglevel is stored. So the user might also decide to store all errors he got in the last two hours or alike.
The LogStream class heavily relies on the LogStreamBuf class, which does the actual buffering and storing, but is only of interest if you want to implement a derived class, as the actual user interface is implemented in the LogStream class.