diff options
Diffstat (limited to 'Source/Core/Common/Logging/LogManager.cpp')
| -rw-r--r-- | Source/Core/Common/Logging/LogManager.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Source/Core/Common/Logging/LogManager.cpp b/Source/Core/Common/Logging/LogManager.cpp index 2c09bc5051..2aef9318e7 100644 --- a/Source/Core/Common/Logging/LogManager.cpp +++ b/Source/Core/Common/Logging/LogManager.cpp @@ -100,18 +100,33 @@ LogManager::LogManager() IniFile::Section* options = ini.GetOrCreateSection("Options"); bool write_file; bool write_console; + bool write_window; options->Get("WriteToFile", &write_file, false); options->Get("WriteToConsole", &write_console, true); + options->Get("WriteToWindow", &write_window, true); + + // Set up log listeners + int verbosity; + options->Get("Verbosity", &verbosity, 0); + + // Ensure the verbosity level is valid + if (verbosity < 1) + verbosity = 1; + if (verbosity > MAX_LOGLEVEL) + verbosity = MAX_LOGLEVEL; for (LogContainer* container : m_Log) { bool enable; logs->Get(container->GetShortName(), &enable, false); container->SetEnable(enable); + container->SetLevel(static_cast<LogTypes::LOG_LEVELS>(verbosity)); if (enable && write_file) container->AddListener(LogListener::FILE_LISTENER); if (enable && write_console) container->AddListener(LogListener::CONSOLE_LISTENER); + if (enable && write_window) + container->AddListener(LogListener::LOG_WINDOW_LISTENER); } m_path_cutoff_point = DeterminePathCutOffPoint(); @@ -149,7 +164,8 @@ void LogManager::LogWithFullPath(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE LogTypes::LOG_LEVEL_TO_CHAR[(int)level], log->GetShortName().c_str(), temp); for (auto listener_id : *log) - m_listeners[listener_id]->Log(level, msg.c_str()); + if (m_listeners[listener_id]) + m_listeners[listener_id]->Log(level, msg.c_str()); } void LogManager::Init() |
