summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKerfuffle <44031344+KerfuffleV2@users.noreply.github.com>2023-09-02 11:53:55 -0600
committerGitHub <noreply@github.com>2023-09-02 11:53:55 -0600
commit3358c381f6251bf6e65855e1c93bfaa9ec82ddb3 (patch)
treefb6c30375d168d4b87b10a3bee378ad9581fdbb7
parent52315a421674ff64305dbf082f69e4ec77f0a3f3 (diff)
logging: Fix creating empty file even when disabled (#2966)
* logging: Fix creating empty file even when disabled * Minor formatting fix Co-authored-by: staviq <staviq@gmail.com> --------- Co-authored-by: staviq <staviq@gmail.com>
-rw-r--r--common/log.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/common/log.h b/common/log.h
index bf9fafd6..0b9b0105 100644
--- a/common/log.h
+++ b/common/log.h
@@ -341,14 +341,14 @@ inline FILE *log_handler1_impl(bool change = false, LogTriState disable = LogTri
}
}
- if (_initialized)
+ if (_disabled)
{
- if (_disabled)
- {
- // Log is disabled
- return nullptr;
- }
+ // Log is disabled
+ return nullptr;
+ }
+ if (_initialized)
+ {
// with fallback in case something went wrong
return logfile ? logfile : stderr;
}