#include <Logger.h>
Public Member Functions | |
void | addMessage (const std::string &message) |
Add a message giving information (sanity checks). | |
void | addWarning (const std::string &message) |
Add a warning message. | |
void | addError (const std::string &message) |
Add an error message. | |
void | addSysInfo (const std::string &message) |
Add a system info message. | |
void | dump (std::ostream &os) |
Dump all messages in the given output stream. | |
void | setEchoOn () |
void | setEchoOff () |
Turn off the echo. | |
Static Private Attributes | |
static bool | echoOn = false |
Specifies whether or not the echo is truned on. | |
static int | numMessages = 0 |
static StringMap | messageList |
Map giving the message for a given message number. | |
static StringMap | messageType |
Map giving the message type (info, warning, ...). |
Class to log messages at various stages of the programs. This class is based on the monostate pattern and all logged messages go into the one and only instance
void Logger::addError | ( | const std::string & | message | ) |
Add an error message.
References messageList, messageType, and numMessages.
Referenced by Table< DataType >::checkData(), Table< DataType >::checkRange(), SloanCoords< DataType >::doit(), QuantitiesByAst< DataType >::doit(), HtmIndex< DataType >::doit(), HlRadii< DataType >::doit(), HlRadCirc< DataType >::doit(), GalacticCoords< DataType >::doit(), RaDecByAst< DataType >::doit2(), and FitsFile::testExpectedKeys().
void Logger::addMessage | ( | const std::string & | message | ) |
Add a message giving information (sanity checks).
References echoOn, messageList, messageType, and numMessages.
Referenced by Provenance< DataType >::build(), CameoSet::CameoSet(), Table< DataType >::checkRange(), SkySubScale< DataType >::doit(), IndirectFrameID< DataType >::doit(), ByteArray::dump(), extractMetadata(), extractSources(), SourceTable::fillExtinctionValues(), SourceTable::finishOff(), ByteArray::gobble(), HtmIndex< DataType >::HtmIndex(), SourceTable::insertAstrometricData(), SourceTable::insertUserSupplied(), DataMethod< DataType >::logInfo(), DataBuilder< DataType >::logInfo(), main(), MergeTable::read(), CameoSet::readCameoData(), Table< DataType >::testDump(), and SourceTable::writeAsBinary().
void Logger::addSysInfo | ( | const std::string & | message | ) |
Add a system info message.
References messageList, messageType, and numMessages.
Referenced by Extension< DataType >::build(), extractMetadata(), extractSources(), and SourceTable::fillExtinctionValues().
void Logger::addWarning | ( | const std::string & | message | ) |
Add a warning message.
References echoOn, messageList, messageType, and numMessages.
Referenced by Table< DataType >::checkData(), IndirectFrameID< DataType >::doit(), ProgrammeTable::getProgrammeId(), insertFitsColumns(), insertKeywordValue(), and Table< DataType >::varcharTest().
void Logger::dump | ( | std::ostream & | os | ) |
Dump all messages in the given output stream.
References messageList, messageType, and numMessages.
void Logger::setEchoOn | ( | ) | [inline] |
Switch on the echo so that the message is printed (on the standard output) immediately after being logged
References echoOn.
bool Logger::echoOn = false [static, private] |
Specifies whether or not the echo is truned on.
Referenced by addMessage(), addWarning(), setEchoOff(), and setEchoOn().
StringMap Logger::messageList [static, private] |
Map giving the message for a given message number.
Referenced by addError(), addMessage(), addSysInfo(), addWarning(), and dump().
StringMap Logger::messageType [static, private] |
Map giving the message type (info, warning, ...).
Referenced by addError(), addMessage(), addSysInfo(), addWarning(), and dump().
int Logger::numMessages = 0 [static, private] |
The total number of messages so far accumulated. This is incremented each time a new message is logged
Referenced by addError(), addMessage(), addSysInfo(), addWarning(), and dump().