Public Member Functions | Protected Attributes
ibis::util::logger Class Reference

A class for logging messages. More...

#include <util.h>

List of all members.

Public Member Functions

 logger (int blanks=0)
 Constructor.
std::ostream & operator() (void)
 Return an output stream for caller to build a message.
 ~logger ()
 Destructor.

Protected Attributes

std::ostringstream mybuffer
 The message is stored in this buffer.

Detailed Description

A class for logging messages.

The caller writes message to a std::ostream returned by the function buffer as if to std::cout. Note that messages are stored in this buffer and written out in the destructor of this class. There is a macro LOGGER that can simplify some of the routine stuff. Use function ibis::util::setLogFile to explicit name of the log file or use RC file entry logfile to specify a file name. By default all messages are dump to stdout.


Constructor & Destructor Documentation

ibis::util::logger::logger ( int  lvl = 0)

Constructor.

The argument to this constructor is taken to be the number of spaces before the message.

When the macro FASTBIT_TIMED_LOG is defined at compile time, a time stamp is printed before the spaces. The number of leading blanks is usually the verboseness level. Typically, a message is formed only if the global verboseness level is higher than the level assigned to the particular message (through the use of LOGGER macro or explicit if statements). In addition, the message is only outputed if the global verboseness level is no less than 0.

References ibis::util::getLocalTime(), and mybuffer.

Destructor.

Output the message and timing information from this function.

References ibis::util::getLogFile(), and ibis::gVerbose.


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

Make It A Bit Faster
Contact us
Disclaimers
FastBit source code
FastBit mailing list archive