Skip to content

Conversation

@ngxson
Copy link
Collaborator

@ngxson ngxson commented Nov 30, 2025

(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

common/arg.cpp Outdated
" - 2: warning\n"
" - 3: info\n"
" - 4: debug\n"
"(default: 3)\n",
Copy link
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
61 of 66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants