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

chore: Improve main logging #238

Open
wants to merge 11 commits into
base: dev
Choose a base branch
from
Open

chore: Improve main logging #238

wants to merge 11 commits into from

Conversation

uristdwarf
Copy link
Collaborator

@uristdwarf uristdwarf commented Nov 4, 2024

Improve logging to better debug errors and where they occured, also use safs functions.

Closes #221

[Only merge after #234]

lgsilva3087
lgsilva3087 previously approved these changes Nov 14, 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.

LGTM. Please see my comment.

src/main/main.cc Outdated Show resolved Hide resolved
@uristdwarf uristdwarf force-pushed the improve-main-logging branch 3 times, most recently from 7139894 to ec2c53d Compare November 29, 2024 07:59
uristdwarf and others added 11 commits December 27, 2024 09:56
This for example allows using environment variables to set logging
levels.
This is to allow other libraries that don't link to common to use it
(e.g slogger)
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.
* Change most current debugs to the lower trace level
* Change magic file log to trace level
* Fix tests to use this new level
* Print system error messages instead of ignoring them
* Use strerr instead of strerror
Improve logging to better debug errors and where they occured, also use
safs functions.

Closes #221
Due to (for whatever reason on earth) main logging the output of the pid
into stderr, any script expecting only this PID in stderr will break.
This fixes it by exiting early after the PID has been acquired
@ralcolea ralcolea force-pushed the improve-main-logging branch from ec2c53d to 80b37dd Compare December 27, 2024 08:56
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