Use log crate for logging

Switches all of the previous `state->verbose`-gated `eprintln!` calls to
use macros from the `log` crate, trying to map them onto the previous
verbosity levels, more or less following this mapping:

0. off
1. error/info/warn (depending on context)
2. trace

This additionally includes a bunch of logic/branch reformatting (and
occasional missed constants), since getting rid of all the gating on
verbose provided ample opportunities to clean up the code. Hopefully I
didn't break too much in the process!
This commit is contained in:
Tony Arcieri
2019-11-20 11:28:43 -08:00
parent f25eed1a86
commit c3d5df1643
5 changed files with 633 additions and 878 deletions
+1
View File
@@ -18,4 +18,5 @@ keywords = ["ccid", "ecdsa", "rsa", "piv", "yubikey"]
[dependencies]
libc = "0.2"
log = "0.4"
zeroize = "1"