mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 07:21:14 +01:00
Logging: Move verbosity setting code to LogManager
No clue why it was in DolphinWX.
This commit is contained in:
parent
10beb2aea1
commit
100c433261
@ -103,11 +103,22 @@ LogManager::LogManager()
|
||||
options->Get("WriteToFile", &write_file, false);
|
||||
options->Get("WriteToConsole", &write_console, 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)
|
||||
|
@ -61,16 +61,6 @@ void CLogWindow::CreateGUIControls()
|
||||
log_window->Get("y", &y, Parent->GetSize().GetY());
|
||||
log_window->Get("pos", &winpos, wxAUI_DOCK_RIGHT);
|
||||
|
||||
// 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;
|
||||
|
||||
// Get the logger output settings from the config ini file.
|
||||
options->Get("WriteToFile", &m_writeFile, false);
|
||||
options->Get("WriteToWindow", &m_writeWindow, true);
|
||||
@ -90,8 +80,6 @@ void CLogWindow::CreateGUIControls()
|
||||
m_LogManager->AddListener((LogTypes::LOG_TYPE)i, LogListener::FILE_LISTENER);
|
||||
else
|
||||
m_LogManager->RemoveListener((LogTypes::LOG_TYPE)i, LogListener::FILE_LISTENER);
|
||||
|
||||
m_LogManager->SetLogLevel((LogTypes::LOG_TYPE)i, (LogTypes::LOG_LEVELS)(verbosity));
|
||||
}
|
||||
m_has_listeners = true;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user