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

eooqd: convert logging to crondlog helper #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Ansuel
Copy link
Contributor

@Ansuel Ansuel commented Nov 3, 2022

Hi,
In an effort to make this tool less verbose, I'm proposing a change to make the loglevel configurable. Since everything is run with cron it would make sense to use crondlog helper to actually log stuff.

This does exactly that. Also I notice that in eooqd we have mixed helper (report and cronlog) and the loglevel is never init resulting in getting everything logged.

Eooqd use a mix of crondlog and report function. Currently there are 2
problems with this:
- LogLevel is never init and is set to 0 by default resulting in
  crondlog to always output verbose output
- Report always log to stderr and can't be configured to mute info log.

Fix this by introducing a new -l option to configure logging and by
converting each logging to use the crondlog helper with the default
level init to 8 following eperd practice.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Currently httppost logs each output to stderr, even debug log. To have a
cleaner log output, add an option to configure the log level by
converting the code to crondlog helper and by providing a new option
--loglevel. The loglevel is init to 8 by default following eperd
practice.

Also change eooqd to pass the same loglevel on calling httppost to
permit better debugging.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
@Ansuel
Copy link
Contributor Author

Ansuel commented Nov 3, 2022

@michel-stam Sorry for the tag spam yesterday and today...

This is a POC (in the sense that it does work and I tested it on my side) but I notice report is also used in 2 other source file... Doing the change seems easy enough (only problem is arbitrary choosing the correct level) but it seems a good idea to have the level configurable in each bin and use a unified helper.

Remember that having debug log is O.K. for container use but not ok if you run other thing on a router for example... In the current state the entire log is filled with atlas debug log making even difficult to catch if there are actual error.

If all of this gets positive feedback I would also propose to add to the ATLAS script a way to configure the default cron log level from the arch scripts. (I will eventually push a pr for that if the busybox changes are approved)

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.

None yet

1 participant