/* * log.cpp * * Created on: Oct 19, 2009 * Author: metzler */ #include "Helpers/MemDebug.hpp" #include "logger.hpp" #include "errorlogger.hpp" /** * Sets verbosity for the error logger and the standard logger. * * \param int verbosity level */ void setVerbosity(int verbosityLevel) { logger::getInstance().setVerbosity(verbosityLevel); } /** * Prints a log entry. * * \param indentation level of the message to log */ class logger& Log() { return logger::getInstance(); } /** Checks verbosity for logger. * Is supposed to be used in construct as this: * DoLog(2) && (Log() << Verbose(2) << "message." << endl); * If DoLog does not return true, the right-hand side is not evaluated and we save some time. * \param verbose verbosity level of this message * \return true - print, false - don't */ bool DoLog(int verbose) { return (verbose <= logger::getInstance().verbosity); } /** Checks verbosity for errorlogger. * Is supposed to be used in construct as this: * DoLog(2) && (Log() << Verbose(2) << "message." << endl); * If DoLog does not return true, the right-hand side is not evaluated and we save some time. * \param verbose verbosity level of this message * \return true - print, false - don't */ bool DoeLog(int verbose) { return (verbose <= errorLogger::getInstance().verbosity); } /** * Prints an error log entry. * * \param indentation level of the message to log */ class errorLogger & eLog() { return errorLogger::getInstance(); }