Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging: add user-adjustable log levels ("err", "warn", "info") #2079

Merged
merged 5 commits into from
Nov 18, 2024

Conversation

francescolavra
Copy link
Member

The msg_{err,warn,info} macros have been repurposed so that in kernel code they expand to log_printf() function calls, which print the supplied message to the console if the log level (supplied as an additional argument) is lower than or equal to the configured kernel log level. The default log level is "err".
Example Ops configuration to set the log level to "info":

  "ManifestPassthrough": {
    "log_level": "info"
  }

Commit 721d2b9 removed the
fs_status enum and the string_from_fs_status() function.
Adapt the tracelog code to use standard error numbers.
When a network socket is created via the socket() syscall, the
supplied type is checked against supported types, so that it is not
possible to create a socket with a non-supported type; therefore,
there is no need to check for non-supported types in the socket
callbacks.
The unix file cache is an objcache, thus it returns INVALID_ADDRESS
on allocation failure.
The log_printf() function now takes an enum log_level parameter,
and prints the message to the console if the supplied level is
lower than or equal than the configured kernel log level (which can
be set via the "log_level" manifest option). The default log level
is "err".
The msg_{err,warn,info} macros have been repurposed so that in
kernel code they expand to log_printf() function calls; calls to
these macros have been modified so that the format string starts
with a sensible prefix; the trailing newline is added by
log_printf(), thus it has been removed from the macro invocations.
Some rprintf() and thread_log() calls have been converted to use
the msg_{print,err,warn,info} macros.
@eyberg
Copy link
Contributor

eyberg commented Nov 16, 2024

@francescolavra francescolavra merged commit f695ae1 into master Nov 18, 2024
7 checks passed
@francescolavra francescolavra deleted the feature/logging branch November 18, 2024 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants