mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-08-22 07:24:06 -04:00
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>
This commit is contained in:
12
common/log.h
12
common/log.h
@@ -341,14 +341,14 @@ 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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user