kanidm / webauthn-rs

An implementation of webauthn components for Rustlang servers
Mozilla Public License 2.0
488 stars 80 forks source link

Replace `println!` from library functions with configurable logging #424

Closed mishazharov closed 6 months ago

mishazharov commented 6 months ago

Developers building on this crate do not necessarily need logging to occur over println! when authenticating 2FA, so this commit replaces the print macros with logging macros

Fixes #

mishazharov commented 6 months ago

It looks like there's some CI failures unrelated to this change:

error: package `bumpalo v3.15.4` cannot be built because it requires rustc 1.73.0 or newer, while the currently active rustc version is 1.70.0
Either upgrade to rustc 1.73.0 or newer, or use
cargo update -p bumpalo@3.15.4 --precise ver
where `ver` is the latest version of `bumpalo` supporting rustc 1.70.0
Error: Process completed with exit code 101.
yaleman commented 6 months ago

@Firstyear how's this one look? Figured I'd ask because you've used it more

micolous commented 6 months ago

Actually @micolous would be the person to ask. There are some places where I think we use these messages as communication points for cli tools.

All the other backends use info!, error!, etc.; the Mozilla backend is the only one which doesn't.

The CLI tools I wrote touch the other backends (as they need to interact with it on a CTAP2 level, rather than an "Authenticator" level), so this would at least make things consistent (as they will eventually replace the Mozilla backend).

I believe the main user of the Mozilla backend is Kanidm's CLI tools – I don't know what makes sense there.

yaleman commented 6 months ago

Libraries really should use the log primitives instead of println so the dependent apps can do what they need to from there...