Closed kquick closed 4 months ago
That might also subsume #55 - we could use info/warn/error
That sounds reasonable, I can make that change. I had somewhat subconsciously been worried about facing the plethora of logger choices that we had with Haskell, but our needs are light and this seems like a reasonable library.
My intended changes would be:
warn
, verbosity 1 would be info
, and verbosity 2 would be debug
. Env var filter name would be "BUILD_BOM_LOG" because this is a wrapper that might invoke other rust apps unless you'd prefer sticking with the default "RUST_LOG".I think we can just stick with RUST_LOG for now. It is a good point that it can invoke other rust programs. I know the cargo build currently freaks out under build-bom.
OK, this is ready to merge again. This includes #55 (because the changes overlapped) and 55 should be abandoned.
I had to create run_bom_command
as an entrypoint for testing because the test framework already establishes a logger and so run_bom
's re-attempt to install a logger would fail. If you would prefer, I can add code instead that handles the duplicate logger initialization failure, but that seemed like awkward code for a situation that should only happen in a testing environment.
[btw, for whatever reason I do not have github privs to select you--or anyone--as a reviewer.]
I'm really surprised I used println. I'm not sure what came over me. I don't want to put a bigger change on you, but what do you think of switching to a proper logger with
env_logger
(https://crates.io/crates/env_logger), which is the easy top-level driver bit for thelog
crate, which provides propererror!
,warn!
andinfo!
macros?