log.cpp File Reference


Detailed Description

Implementation of Log class.

Definition in file log.cpp.

#include <hn/hnprec.h>
#include <hn/osdep.h>
#include <hn/log.h>
#include <boost/date_time/posix_time/posix_time.hpp>

Include dependency graph for log.cpp:

Go to the source code of this file.


Functions

void logMsg (const std::string &msg)
 Log a simple message.
void logMsg (const boost::format &fmt)
 Log a formatted mesage.
void logDebug (const std::string &msg)
 Log a simple message only in debug mode.
void logDebug (const boost::format &fmt)
 Log a formatted message only in debug mode.
void logWarning (const std::string &msg)
 Log a warning (message will be prepended by "Warning:".
void logWarning (const boost::format &fmt)
 Log a formatted warning (message will be prepended by "Warning:".
void logError (const std::string &msg)
 Log an error (message will be prepended by "Error:").
void logError (const boost::format &fmt)
 Log a formatted error message (message will be prepended by "Error:").
void logFatalError (const std::string &msg)
 Log a fatal error and abort the application.
void logFatalError (const boost::format &fmt)
 Log a fatal error and abort the application.
void logTrace (uint32_t mask, const boost::format &msg)
void logTrace (uint32_t mask, const std::string &msg)
void logTrace (const std::string &mask, const std::string &msg)
void logTrace (const std::string &mask, const boost::format &msg)

Function Documentation

void logDebug const boost::format &  fmt  ) 
 

Log a formatted message only in debug mode.

Parameters:
fmt Format object to be logged

Definition at line 137 of file log.cpp.

References logDebug().

Here is the call graph for this function:

void logDebug const std::string &  msg  ) 
 

Log a simple message only in debug mode.

Parameters:
msg Message to be logged

Definition at line 122 of file log.cpp.

References Log::doLogString(), Log::instance(), and MT_DEBUG.

Referenced by Object::addChild(), FilesList::createDownload(), Object::delChild(), PartData::deleteFiles(), UDPSocket::destroy(), PartData::doGetRange(), FilesList::doOper(), SchedBase::error(), SchedBase::exit(), HashWork::finish(), SchedBase::handleDownloads(), SocketWatcher::handleErronousSocket(), SocketWatcher::handleReadableSocket(), SchedBase::handleUploads(), SocketWatcher::handleWritableSocket(), UDPSocket::listen(), SocketServer::listen(), FilesList::loadTempFile(), logDebug(), SharedFile::onHashEvent(), PartData::onHashEvent(), SharedFile::onPartEvent(), FilesList::remSharedDir(), FilesList::remTempDir(), FilesList::scanTempDir(), UDPSocket::send(), and socketError().

Here is the call graph for this function:

void logError const boost::format &  fmt  ) 
 

Log a formatted error message (message will be prepended by "Error:").

Parameters:
fmt Formatted message to be logged

Definition at line 185 of file log.cpp.

References logError().

Here is the call graph for this function:

void logError const std::string &  msg  ) 
 

Log an error (message will be prepended by "Error:").

Parameters:
msg Message to be logged

Definition at line 173 of file log.cpp.

References COL_NONE, COL_RED, Log::doLogString(), Log::instance(), and MT_ERROR.

Referenced by ArchiveMetaData::ArchiveMetaData(), AudioMetaData::AudioMetaData(), HydraNode::checkCreateDir(), FilesList::doOper(), HashSet< HashType, FileHashType, ChunkSize >::HashSet(), ImageMetaData::ImageMetaData(), HydraNode::initFiles(), HashWork::initState(), MetaDb::load(), ModManager::loadModule(), FilesList::loadTempFile(), logError(), logFatalError(), MetaData::MetaData(), SharedFile::onHashEvent(), PartData::onHashEvent(), Detail::Chunk::onHashEvent(), operator<<(), Config::save(), WorkThread::threadLoop(), ModManager::unloadModule(), PartData::verifyHashSet(), and VideoMetaData::VideoMetaData().

Here is the call graph for this function:

void logFatalError const boost::format &  fmt  ) 
 

Log a fatal error and abort the application.

Parameters:
fmt Formatted message to be logged

Definition at line 205 of file log.cpp.

References logFatalError().

Here is the call graph for this function:

void logFatalError const std::string &  msg  ) 
 

Log a fatal error and abort the application.

Parameters:
msg Message to be logged

Definition at line 195 of file log.cpp.

References logError().

Referenced by logFatalError().

Here is the call graph for this function:

void logMsg const boost::format &  fmt  ) 
 

Log a formatted mesage.

Parameters:
fmt Format object to be logged

Definition at line 112 of file log.cpp.

References logMsg().

Here is the call graph for this function:

void logMsg const std::string &  msg  ) 
 

Log a simple message.

Parameters:
msg Message to be logged

Definition at line 102 of file log.cpp.

References Log::doLogString(), Log::instance(), and MT_MSG.

Referenced by HydraNode::cleanup(), FilesList::createDownload(), SchedBase::exit(), HydraNode::init(), HydraNode::initConfig(), HydraNode::initFiles(), HydraNode::initLog(), HashWork::initState(), SharedFile::isDuplicate(), MetaDb::load(), ModManager::loadModule(), logMsg(), HydraNode::onEvent(), ModManager::onInit(), SharedFile::onMoveEvent(), PartData::PartData(), MoveWork::process(), FilesList::scanSharedDir(), FilesList::scanTempDir(), SchedBase::SchedBase(), ModManager::unloadModule(), and FilesList::~FilesList().

Here is the call graph for this function:

void logTrace const std::string &  mask,
const boost::format &  msg
 

Definition at line 220 of file log.cpp.

References Log::doLogString(), and Log::instance().

Here is the call graph for this function:

void logTrace const std::string &  mask,
const std::string &  msg
 

Definition at line 217 of file log.cpp.

References Log::doLogString(), and Log::instance().

Here is the call graph for this function:

void logTrace uint32_t  mask,
const std::string &  msg
 

Definition at line 214 of file log.cpp.

References Log::doLogString(), and Log::instance().

Here is the call graph for this function:

void logTrace uint32_t  mask,
const boost::format &  msg
 

Definition at line 211 of file log.cpp.

References Log::doLogString(), and Log::instance().

Referenced by Object::addChild(), Scheduler< Impl, ImplPtr >::addSocket(), ArchiveMetaData::ArchiveMetaData(), AudioMetaData::AudioMetaData(), Detail::Chunk::Chunk(), SocketWatcher::cleanupSockets(), SocketServer::close(), SocketClient::close(), HashSetBase::compare(), SocketClient::connect(), Scheduler< Impl, ImplPtr >::delSocket(), SocketClient::disconnect(), SocketWatcher::doAddSocket(), Object::doOper(), PartData::doWrite(), Config::dump(), MetaDb::find(), SharedFile::findMetaData(), PartData::flushBuffer(), Object::getData(), Object::getFieldName(), Object::getOper(), SchedBase::handleConnections(), SocketWatcher::handleErronousSocket(), SocketWatcher::handleReadableSocket(), SocketWatcher::handleWritableSocket(), ImageMetaData::ImageMetaData(), ModManager::initialize(), Scheduler< Impl, ImplPtr >::invalidateReqs(), UDPSocket::listen(), SocketServer::listen(), ModManager::load(), MetaDb::load(), Config::load(), CGComm::loadHashSet(), Detail::LockedRange::LockedRange(), MetaData::MetaData(), PartData::onHashEvent(), Detail::Chunk::onHashEvent(), operator<<(), PartData::PartData(), PartData::printCompleted(), Config::save(), UDPSocket::send(), Object::setData(), SharedFile::SharedFile(), SocketClient::SocketClient(), SocketServer::SocketServer(), MetaDb::tryAddFileName(), MetaDb::tryAddHashSet(), UDPSocket::UDPSocket(), ModManager::unloadModule(), SharedFile::updateModDate(), Detail::UsedRange::UsedRange(), SharedFile::verify(), Detail::Chunk::verify(), VideoMetaData::VideoMetaData(), PartData::write(), Detail::LockedRange::~LockedRange(), SocketServer::~SocketServer(), and Detail::UsedRange::~UsedRange().

Here is the call graph for this function:

void logWarning const boost::format &  fmt  ) 
 

Log a formatted warning (message will be prepended by "Warning:".

Parameters:
fmt Formatted message to be logged

Definition at line 163 of file log.cpp.

References logWarning().

Here is the call graph for this function:

void logWarning const std::string &  msg  ) 
 

Log a warning (message will be prepended by "Warning:".

Parameters:
msg Message to be logged

Definition at line 151 of file log.cpp.

References COL_NONE, COL_YELLOW, Log::doLogString(), Log::instance(), and MT_WARNING.

Referenced by ArchiveMetaData::ArchiveMetaData(), AudioMetaData::AudioMetaData(), SharedFile::checkFileSize(), SocketServer::close(), SocketClient::close(), ImageMetaData::ImageMetaData(), Config::load(), ModManager::loadModule(), logWarning(), MetaData::MetaData(), SchedEventHandler::ClientEventHandler< Source, Scheduler >::onEvent(), Detail::Chunk::onHashEvent(), MetaDb::onSharedFileEvent(), PartData::PartData(), ModManager::unloadModule(), Detail::Chunk::verify(), and VideoMetaData::VideoMetaData().

Here is the call graph for this function: