mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
Logging API: - removed unused method declaration - updated comments - ensured thread safety
This commit is contained in:
@@ -60,7 +60,7 @@ DLL_LINKAGE CLogger * logAnim = CLogger::getLogger(CLoggerDomain("animation"));
|
|||||||
|
|
||||||
CLogger * CLogger::getLogger(const CLoggerDomain & domain)
|
CLogger * CLogger::getLogger(const CLoggerDomain & domain)
|
||||||
{
|
{
|
||||||
boost::lock_guard<boost::recursive_mutex> _(smx);
|
TLockGuardRec _(smx);
|
||||||
|
|
||||||
CLogger * logger = CLogManager::get().getLogger(domain);
|
CLogger * logger = CLogManager::get().getLogger(domain);
|
||||||
if(logger)
|
if(logger)
|
||||||
|
@@ -69,7 +69,8 @@ private:
|
|||||||
std::stringstream * sbuffer;
|
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
|
class DLL_LINKAGE CLogger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -109,7 +110,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
explicit CLogger(const CLoggerDomain & domain);
|
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 ELogLevel::ELogLevel getEffectiveLevel() const; /// Returns the log level applied on this logger whether directly or indirectly.
|
||||||
inline void callTargets(const LogRecord & record) const;
|
inline void callTargets(const LogRecord & record) const;
|
||||||
|
|
||||||
@@ -245,7 +245,9 @@ private:
|
|||||||
std::map<std::string, std::map<ELogLevel::ELogLevel, EConsoleTextColor::EConsoleTextColor> > map;
|
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
|
class DLL_LINKAGE CLogConsoleTarget : public ILogTarget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -274,7 +276,9 @@ private:
|
|||||||
mutable boost::mutex mx;
|
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
|
class DLL_LINKAGE CLogFileTarget : public ILogTarget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
Reference in New Issue
Block a user