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

feat(slogger): Improve logging #234

Merged
merged 7 commits into from
Jan 8, 2025
Merged

feat(slogger): Improve logging #234

merged 7 commits into from
Jan 8, 2025

Conversation

uristdwarf
Copy link
Collaborator

These commits aim to improve the logging capabilities, and allow more fine-grained control of it. It also removes the -d option spamming worthless debug messages (by lowering them to trace, and using the config file to determine the logging level).

lgsilva3087
lgsilva3087 previously approved these changes Dec 3, 2024
Copy link
Contributor

@lgsilva3087 lgsilva3087 left a comment

Choose a reason for hiding this comment

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

The change is very good. Please see my suggestions.

rolysr
rolysr previously approved these changes Dec 18, 2024
Copy link
Collaborator

@rolysr rolysr left a comment

Choose a reason for hiding this comment

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

LGTM.

dmga44
dmga44 previously approved these changes Dec 18, 2024
Copy link
Collaborator

@dmga44 dmga44 left a comment

Choose a reason for hiding this comment

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

LGTM.

This for example allows using environment variables to set logging
levels.

Signed-off-by: Urmas Rist <urmas@leil.io>
This is to allow other libraries that don't link to common to use it
(e.g slogger)

Signed-off-by: Urmas Rist <urmas@leil.io>
Previously, it wasn't possible to setup specific log levels. You had
had to start with -d (debug) mode to get debug messages. This commit
introduces adding specifc log levels using either LOG_LEVEL in config
file, or using SAUNAFS_LOG_LEVEL from the environment

It also fixes -d always setting the level to debug, which is what you
may not want if you want the process to run in the foreground.

Signed-off-by: Urmas Rist <urmas@leil.io>
* Change most current debugs to the lower trace level
* Change magic file log to trace level
* Fix tests to use this new level

Signed-off-by: Urmas Rist <urmas@leil.io>
Signed-off-by: Urmas Rist <urmas@leil.io>
Signed-off-by: Urmas Rist <urmas@leil.io>
* Print system error messages instead of ignoring them

Signed-off-by: Urmas Rist <urmas@leil.io>
Copy link
Collaborator

@dmga44 dmga44 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@rolysr rolysr left a comment

Choose a reason for hiding this comment

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

LGTM

@uristdwarf uristdwarf merged commit 15597f5 into dev Jan 8, 2025
5 checks passed
@uristdwarf uristdwarf deleted the logging-improv branch February 3, 2025 10:18
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.

4 participants