logging: Fix creating empty file even when disabled

This commit is contained in:
KerfuffleV2 2023-09-02 03:18:36 -06:00
parent 571083f508
commit 019f30dfcb

View file

@ -341,14 +341,13 @@ inline FILE *log_handler1_impl(bool change = false, LogTriState disable = LogTri
}
}
if (_initialized)
{
if (_disabled)
{
// Log is disabled
return nullptr;
}
if (_initialized)
{
// with fallback in case something went wrong
return logfile ? logfile : stderr;
}