mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 03:59:56 +00:00
Use OpenMW logging levels for MyGUI log (feature 7130)
This commit is contained in:
parent
7f117a28c8
commit
b217d1fc36
3 changed files with 17 additions and 1 deletions
|
@ -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
|
||||
------
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue