1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Logging API: - removed unused method declaration - updated comments - ensured thread safety

This commit is contained in:
beegee1 2014-05-10 21:12:33 +02:00
parent 3e101d89ef
commit 60f6c00f2e
2 changed files with 9 additions and 5 deletions

View File

@ -60,7 +60,7 @@ DLL_LINKAGE CLogger * logAnim = CLogger::getLogger(CLoggerDomain("animation"));
CLogger * CLogger::getLogger(const CLoggerDomain & domain)
{
boost::lock_guard<boost::recursive_mutex> _(smx);
TLockGuardRec _(smx);
CLogger * logger = CLogManager::get().getLogger(domain);
if(logger)

View File

@ -69,7 +69,8 @@ private:
std::stringstream * sbuffer;
};
/// The class CLogger is used to log messages to certain targets of a specific domain/name.
/// The logger is used to log messages to certain targets of a specific domain/name.
/// It is thread-safe and can be used concurrently by several threads.
class DLL_LINKAGE CLogger
{
public:
@ -109,7 +110,6 @@ public:
private:
explicit CLogger(const CLoggerDomain & domain);
CLogger * getParent() const;
inline ELogLevel::ELogLevel getEffectiveLevel() const; /// Returns the log level applied on this logger whether directly or indirectly.
inline void callTargets(const LogRecord & record) const;
@ -245,7 +245,9 @@ private:
std::map<std::string, std::map<ELogLevel::ELogLevel, EConsoleTextColor::EConsoleTextColor> > map;
};
/// The class CLogConsoleTarget is a logging target which writes message to the console.
/// This target is a logging target which writes message to the console.
/// The target may be shared among multiple loggers. All methods except write aren't thread-safe.
/// The console target is intended to be configured once and then added to a logger.
class DLL_LINKAGE CLogConsoleTarget : public ILogTarget
{
public:
@ -274,7 +276,9 @@ private:
mutable boost::mutex mx;
};
/// The class CLogFileTarget is a logging target which writes messages to a log file.
/// This target is a logging target which writes messages to a log file.
/// The target may be shared among multiple loggers. All methods except write aren't thread-safe.
/// The file target is intended to be configured once and then added to a logger.
class DLL_LINKAGE CLogFileTarget : public ILogTarget
{
public: