logging: Fix creating empty file even when disabled
This commit is contained in:
parent
571083f508
commit
019f30dfcb
1 changed files with 5 additions and 6 deletions
11
common/log.h
11
common/log.h
|
@ -341,14 +341,13 @@ inline FILE *log_handler1_impl(bool change = false, LogTriState disable = LogTri
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_disabled)
|
||||||
|
{
|
||||||
|
// Log is disabled
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
if (_initialized)
|
if (_initialized)
|
||||||
{
|
{
|
||||||
if (_disabled)
|
|
||||||
{
|
|
||||||
// Log is disabled
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
// with fallback in case something went wrong
|
// with fallback in case something went wrong
|
||||||
return logfile ? logfile : stderr;
|
return logfile ? logfile : stderr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue