Skip to content

Commit 3358c38

Browse files
KerfuffleV2staviq
andauthored
logging: Fix creating empty file even when disabled (#2966)
* logging: Fix creating empty file even when disabled * Minor formatting fix Co-authored-by: staviq <[email protected]> --------- Co-authored-by: staviq <[email protected]>
1 parent 52315a4 commit 3358c38

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

common/log.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -341,14 +341,14 @@ inline FILE *log_handler1_impl(bool change = false, LogTriState disable = LogTri
341341
}
342342
}
343343

344-
if (_initialized)
344+
if (_disabled)
345345
{
346-
if (_disabled)
347-
{
348-
// Log is disabled
349-
return nullptr;
350-
}
346+
// Log is disabled
347+
return nullptr;
348+
}
351349

350+
if (_initialized)
351+
{
352352
// with fallback in case something went wrong
353353
return logfile ? logfile : stderr;
354354
}

0 commit comments

Comments
 (0)