17 LogManager* LogManager::msInstance =
nullptr;
23 mDefaultSource(nullptr),
35 delete mDefaultSource;
36 mDefaultSource =
nullptr;
60 for (VectorLogSource::iterator item = mSources.begin(); item != mSources.end(); ++item)
64 void LogManager::log(
const std::string& _section,
LogLevel _level,
const std::string& _message,
const char* _file,
int _line)
68 struct tm* currentTime;
69 currentTime = localtime(&ctTime);
71 for (VectorLogSource::iterator item = mSources.begin(); item != mSources.end(); ++item)
72 (*item)->log(_section, _level, currentTime, _message, _file, _line);
75 void LogManager::close()
77 for (VectorLogSource::iterator item = mSources.begin(); item != mSources.end(); ++item)
83 mSources.push_back(_source);
104 mDefaultSource->
open();
111 mConsoleEnable = _value;
113 if (mConsole !=
nullptr)
119 return mConsoleEnable;
126 if (mFilter !=
nullptr)
#define MYGUI_ASSERT(exp, dest)
void setEnabled(bool _value)
void setFileName(const std::string &_value)
void setLoggingLevel(LogLevel _value)
void setSTDOutputEnabled(bool _value)
void addLogSource(LogSource *_source)
static LogManager * getInstancePtr()
LogLevel getLoggingLevel() const
void createDefaultSource(const std::string &_logname)
void setLoggingLevel(LogLevel _value)
static LogManager & getInstance()
void log(const std::string &_section, LogLevel _level, const std::string &_message, const char *_file, int _line)
bool getSTDOutputEnabled() const
void setLogFilter(ILogFilter *_filter)
void addLogListener(ILogListener *_lestener)