ik_llama_opt/common
Skelectric 1d76336eeb
fix(server): capture all server log sinks in --log-file, gated on explicit flag (#2313)
Previously --log-file only captured LOG()/LOG_TEE() macro output; the
LLAMA_LOG_* engine lines, server_log() output, and common_log (SLT_*/SRV_*)
slot/checkpoint lines all went to stderr only.

Route all three sinks to --log-file:
- llama_log_tee_callback tees raw llama/ggml output to the file and stderr
- server_log() mirrors its stdout line to the file
- common_log_set_file_ptr() shares LOG_TARGET's FILE* with the common_log
  worker, which natively tees to stderr and file (so the SLT_*/SRV_* macros
  stay untouched and bare LOG_*/QUE_*/RES_* calls are captured too)

Gate every sink on log_target_changed() (set only by log_set_target_impl(),
the wrapper --log-file calls) plus a != stdout && != stderr guard mirroring
LOG_TEE_IMPL. LOG_TARGET is non-null by default (log_handler() lazily opens
llama.log), so a plain null check would capture every line into a surprise
llama.log with no flag, and on a non-writable cwd would double-print to
stderr. log_target_changed() is marked at the wrapper rather than inside
log_handler1_impl because --log-file is parsed before any LOG() call, making
the first invocation's filename comparison vacuously false.

common_log_set_file_ptr shares the already-opened FILE* rather than calling
common_log_set_file, whose own fopen("w") would open a second handle on the
same path and let the two writes corrupt each other.
2026-08-26 19:34:25 +02:00
..
cmake Merge mainline llama.cpp (#3) 2024-07-27 07:55:01 +02:00
jinja Chores : Typos fixing round 3 (project wide, ggml dir included, comments and user facing msg only) (#2249) 2026-08-04 07:15:28 +03:00
CMakeLists.txt server: enable mcp proxy (#1904) 2026-06-04 15:43:07 +02:00
base64.hpp llava : expose as a shared library for downstream projects (#3613) 2023-11-07 00:36:23 +03:00
build-info.cpp.in build : link against build info instead of compiling against it (#3879) 2023-11-02 08:50:16 +02:00
chat-auto-parser-generator.cpp chat: fix multi-argument tool calls for tagged templates (#2351) 2026-08-25 09:38:39 +02:00
chat-auto-parser-helpers.cpp Autoparser - complete refactoring of parser architecture (#1376) 2026-04-22 10:04:13 +02:00
chat-auto-parser-helpers.h Autoparser - complete refactoring of parser architecture (#1376) 2026-04-22 10:04:13 +02:00
chat-auto-parser.h common: handle Laguna chat delimiters (#1943) 2026-06-10 07:46:19 +02:00
chat-diff-analyzer.cpp model: add openPangu-2.0-Flash (92B-A6B) with MLA-latent cache, DSA/SWA, mHC, and multi-head MTP (#2065) 2026-07-11 12:29:20 +03:00
chat-peg-parser.cpp fix: MiniMax-M3 streaming parser when tool calls start before `</mm:think>` (#2085) 2026-07-09 18:12:47 +03:00
chat-peg-parser.h fix: MiniMax-M3 streaming parser when tool calls start before `</mm:think>` (#2085) 2026-07-09 18:12:47 +03:00
chat.cpp Fix DSV4 tool calls and reasoning (#2242) 2026-08-04 19:28:06 +03:00
chat.h fix: MiniMax-M3 streaming parser when tool calls start before `</mm:think>` (#2085) 2026-07-09 18:12:47 +03:00
common.cpp dflash: use draft context as capacity contract (#2341) 2026-08-26 18:26:50 +02:00
common.h dflash: use draft context as capacity contract (#2341) 2026-08-26 18:26:50 +02:00
console.cpp check C++ code with -Wmissing-declarations (#3184) 2023-09-15 15:38:27 -04:00
console.h gguf : new file format with flexible meta data (beta) (#2398) 2023-08-21 23:07:43 +03:00
http.h server: enable mcp proxy (#1904) 2026-06-04 15:43:07 +02:00
json-partial.cpp common : introduce composable PEG parser combinators for chat parsing and new jinja template engine (#1369) 2026-03-09 11:03:33 +01:00
json-partial.h Move minja and nlohmann/json to vendor (#802) 2025-09-27 09:12:35 +02:00
json-schema-to-grammar.cpp Autoparser - complete refactoring of parser architecture (#1376) 2026-04-22 10:04:13 +02:00
json-schema-to-grammar.h common : introduce composable PEG parser combinators for chat parsing and new jinja template engine (#1369) 2026-03-09 11:03:33 +01:00
llguidance.cpp Tool calls support from mainline (#723) 2025-09-01 08:38:49 +03:00
log.cpp fix(server): capture all server log sinks in --log-file, gated on explicit flag (#2313) 2026-08-26 19:34:25 +02:00
log.h fix(server): capture all server log sinks in --log-file, gated on explicit flag (#2313) 2026-08-26 19:34:25 +02:00
ngram-cache.cpp spec : add self speculative decoding, ngram and refactor (#1261) 2026-02-13 19:04:55 +01:00
ngram-cache.h spec : add self speculative decoding, ngram and refactor (#1261) 2026-02-13 19:04:55 +01:00
ngram-map.cpp Chores : tidy up more typos project wide (ggml directory excluded), new -ptcall alias (#2237) 2026-08-03 08:01:18 +03:00
ngram-map.h Chores : tidy up more typos project wide (ggml directory excluded), new -ptcall alias (#2237) 2026-08-03 08:01:18 +03:00
ngram-mod.cpp spec : add self speculative decoding, ngram and refactor (#1261) 2026-02-13 19:04:55 +01:00
ngram-mod.h spec : add self speculative decoding, ngram and refactor (#1261) 2026-02-13 19:04:55 +01:00
peg-parser.cpp Autoparser - complete refactoring of parser architecture (#1376) 2026-04-22 10:04:13 +02:00
peg-parser.h Autoparser - complete refactoring of parser architecture (#1376) 2026-04-22 10:04:13 +02:00
reasoning-budget.cpp Remove reasoning budget logs (#1846) 2026-05-20 07:12:02 +03:00
reasoning-budget.h AutoParser: improve reasoning budget and handling of space/newline in tool calls (#1819) 2026-05-19 08:34:19 +03:00
regex-partial.cpp Autoparser - complete refactoring of parser architecture (#1376) 2026-04-22 10:04:13 +02:00
regex-partial.h Tool calls support from mainline (#723) 2025-09-01 08:38:49 +03:00
sampling.cpp Dflash 2 speculative decoding (#2345) 2026-08-26 17:09:34 +02:00
sampling.h Dflash 2 speculative decoding (#2345) 2026-08-26 17:09:34 +02:00
spec-tuner.cpp feat: allow dflash to work with spec auto tune (#2112) 2026-07-12 07:49:03 +03:00
spec-tuner.h feat: allow dflash to work with spec auto tune (#2112) 2026-07-12 07:49:03 +03:00
speculative-dflash-impl.h dflash: use draft context as capacity contract (#2341) 2026-08-26 18:26:50 +02:00
speculative.cpp dflash: use draft context as capacity contract (#2341) 2026-08-26 18:26:50 +02:00
speculative.h Dflash 2 speculative decoding (#2345) 2026-08-26 17:09:34 +02:00
suffix-tree.cpp Standardize speculative decoding arguments on the server (#1908) 2026-06-04 15:44:57 +02:00
suffix-tree.h Self-decoding: Adds support for suffix decoding (#1646) 2026-04-18 16:10:10 +02:00
train.cpp Server: refactor and rename functions (#1151) 2026-01-18 08:16:57 +02:00
train.h sync : ggml (backend v2) (#3912) 2023-11-13 14:16:23 +02:00
unicode.cpp Autoparser - complete refactoring of parser architecture (#1376) 2026-04-22 10:04:13 +02:00
unicode.h Autoparser - complete refactoring of parser architecture (#1376) 2026-04-22 10:04:13 +02:00