mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-29 09:32:45 +00:00
Merge pull request #1966 from akortunov/logfix
Allow apps without logging system to display log messages
This commit is contained in:
commit
53ccce1867
@ -8,12 +8,13 @@ namespace Debug
|
|||||||
{
|
{
|
||||||
enum Level
|
enum Level
|
||||||
{
|
{
|
||||||
NoLevel = 0,
|
|
||||||
Error = 1,
|
Error = 1,
|
||||||
Warning = 2,
|
Warning = 2,
|
||||||
Info = 3,
|
Info = 3,
|
||||||
Verbose = 4,
|
Verbose = 4,
|
||||||
Marker = Verbose
|
Marker = Verbose,
|
||||||
|
|
||||||
|
NoLevel = 5 // Do not filter messages in this case
|
||||||
};
|
};
|
||||||
|
|
||||||
extern Level CurrentDebugLevel;
|
extern Level CurrentDebugLevel;
|
||||||
@ -30,6 +31,11 @@ public:
|
|||||||
mLock(sLock),
|
mLock(sLock),
|
||||||
mLevel(level)
|
mLevel(level)
|
||||||
{
|
{
|
||||||
|
// If the app has no logging system enabled, log level is not specified.
|
||||||
|
// Show all messages without marker - we just use the plain cout in this case.
|
||||||
|
if (Debug::CurrentDebugLevel == Debug::NoLevel)
|
||||||
|
return;
|
||||||
|
|
||||||
if (mLevel <= Debug::CurrentDebugLevel)
|
if (mLevel <= Debug::CurrentDebugLevel)
|
||||||
std::cout << static_cast<unsigned char>(mLevel);
|
std::cout << static_cast<unsigned char>(mLevel);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user