1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-21 04:20:48 +00:00

Merge branch 'mygui_log' into 'master'

Use OpenMW logging levels for MyGUI log

Closes #7130

See merge request OpenMW/openmw!2582
This commit is contained in:
psi29a 2023-01-06 15:09:46 +00:00
commit 55ba5ed7ea
3 changed files with 17 additions and 1 deletions

View File

@ -37,6 +37,7 @@
Feature #6995: Localize the "show effect duration" option
Feature #7058: Implement TestModels (T3D) console command
Feature #7087: Block resolution change in the Windowed Fullscreen mode
Feature #7130: Ability to set MyGUI logging verbosity
0.48.0
------

View File

@ -37,4 +37,17 @@ namespace osgMyGUI
<< separator << _line << std::endl;
}
}
MyGUI::LogLevel LogFacility::getCurrentLogLevel() const
{
switch (Debug::CurrentDebugLevel)
{
case Debug::Error:
return MyGUI::LogLevel::Error;
case Debug::Warning:
return MyGUI::LogLevel::Warning;
default:
return MyGUI::LogLevel::Info;
}
}
}

View File

@ -47,12 +47,14 @@ namespace osgMyGUI
MyGUI::LevelLogFilter mFilter;
MyGUI::LogSource mSource;
MyGUI::LogLevel getCurrentLogLevel() const;
public:
LogFacility(const std::filesystem::path& output, bool console)
: mFile(output)
{
mConsole.setEnabled(console);
mFilter.setLoggingLevel(MyGUI::LogLevel::Info);
mFilter.setLoggingLevel(getCurrentLogLevel());
mSource.addLogListener(&mFile);
mSource.addLogListener(&mConsole);