Logging: Remove duplicated code

This commit is contained in:
Léo Lam
2017-06-13 14:35:42 +02:00
parent 100c433261
commit a2ad3e14d0
3 changed files with 6 additions and 24 deletions

View File

@ -100,8 +100,10 @@ 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;
@ -123,6 +125,8 @@ LogManager::LogManager()
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();