Skip to content

common: improve verbosity level definitions#17630

Merged
ngxson merged 3 commits into
ggml-org:masterfrom
ngxson:xsn/improve_common_log
Dec 1, 2025
Merged

common: improve verbosity level definitions#17630
ngxson merged 3 commits into
ggml-org:masterfrom
ngxson:xsn/improve_common_log

Conversation

@ngxson

@ngxson ngxson commented Nov 30, 2025

Copy link
Copy Markdown
Collaborator

(This change is part of the plan to use server code inside CLI)

The current log verbosity is not very useful as it only has 3 levels: (-1) logs nothing, (0) default, (1) debug

This PR adds more hierarchy so that "the higher verbosity number, more stuff get logged":

#define LOG_LEVEL_DEBUG  4
#define LOG_LEVEL_INFO   3
#define LOG_LEVEL_WARN   2
#define LOG_LEVEL_ERROR  1
#define LOG_LEVEL_OUTPUT 0 // output data from tools

For CLI and most applications, the output (for example, generated text, json, csv, etc) can be written using LOG_LEVEL_OUTPUT, which is equivalent to the LOG(...) macro

The default verbosity for future CLI application (server based) will ideally be ERROR, this is because WARN also log some redundant stuff in the middle of the conversation

Comment thread common/arg.cpp Outdated
" - 2: warning\n"
" - 3: info\n"
" - 4: debug\n"
"(default: 3)\n",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string_format the actual default value

@ngxson ngxson merged commit 7733409 into ggml-org:master Dec 1, 2025
62 of 66 checks passed
Anico2 added a commit to Anico2/llama.cpp that referenced this pull request Jan 15, 2026
* common: improve verbosity level definitions

* string_format

* update autogen docs
blime4 referenced this pull request in blime4/llama.cpp Feb 5, 2026
* common: improve verbosity level definitions

* string_format

* update autogen docs
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
* common: improve verbosity level definitions

* string_format

* update autogen docs
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
* common: improve verbosity level definitions

* string_format

* update autogen docs
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
* common: improve verbosity level definitions

* string_format

* update autogen docs
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
* common: improve verbosity level definitions

* string_format

* update autogen docs
phibya pushed a commit to ziee-ai/llama.cpp that referenced this pull request May 29, 2026
* common: improve verbosity level definitions

* string_format

* update autogen docs
fewtarius pushed a commit to fewtarius/CachyLLama that referenced this pull request May 30, 2026
* common: improve verbosity level definitions

* string_format

* update autogen docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants