Skip to content

Commit

Permalink
logging: Fix creating empty file even when disabled (ggerganov#2966)
Browse files Browse the repository at this point in the history
* logging: Fix creating empty file even when disabled

* Minor formatting fix

Co-authored-by: staviq <[email protected]>

---------

Co-authored-by: staviq <[email protected]>
  • Loading branch information
KerfuffleV2 and staviq authored Sep 2, 2023
1 parent 52315a4 commit 3358c38
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions common/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3358c38

Please sign in to comment.