[pbs-devel] [PATCH-SERIES] replace print by log macro in libraries
Wolfgang Bumiller
w.bumiller at proxmox.com
Thu Mar 17 09:40:57 CET 2022
I like the direction of this.
On Fri, Mar 11, 2022 at 03:07:45PM +0000, Hannes Laimer wrote:
> This series mostly replaces print with the log macro in libs, it also replaces print
> in binaries where it is used to log stuff and not output the result of a command.
> In the process of replacing prints by log macros a few parameters controlling verbosity
> became obsolete and were removed, other 'verbose' parameters influenced the control
> flow and where therefore kept.
Where does verbosity affect control flow? That sounds strange.
And I don't think we should just *drop* `--verbose` parameters. I do
think it would be good to *have* them, either by promoting
previously-verbose output to `log::debug` and making the parameter
affect the filter, or by using a task-local variable we don't need to
hand down through all the function calls, though the latter might be a
bit more involved (given that eg. tokio's LocalKey is not inherited
across `spawn()`...)
> The whole changes were split up into 7 seperate patches[3-9], this was done
> to aviod one huge patch file and improve readability. Those (maybe also 2)
> should be squashed when applied since they are not necesarilly buildable.
> The reason for that is that in a few places 'verbose' parameters were remove.
>
> A verion bump is also needed since patches 2 (and indirectly 3-10) depend on
> the function added to proxmox-router in patch 1.
As for the helper... I'm a bit unsure here.
We currently always pass "info", and we use "PBS_LOG" as env var
everywhere except the pxar binary.
While on the one hand flexibility would be nice... I think we could
also just drop the parameters (or make them `Option`s)?
More information about the pbs-devel
mailing list