From 51f61abb710684ffa2f5958ce3e6b0f9d5e8e98e Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Tue, 23 Dec 2025 13:59:02 -0800 Subject: Fix logging --- Cargo.lock | 41 +++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 1 + src/bin/sso/main.rs | 2 ++ 3 files changed, 44 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 2e7babd..dfa0983 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -259,6 +259,19 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "env_logger" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + [[package]] name = "equivalent" version = "1.0.2" @@ -456,6 +469,15 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "humantime" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" +dependencies = [ + "quick-error", +] + [[package]] name = "hyper" version = "0.14.32" @@ -694,6 +716,7 @@ version = "0.1.5" dependencies = [ "chrono", "clap", + "env_logger", "gethostname", "log", "oauth2", @@ -919,6 +942,12 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + [[package]] name = "quote" version = "1.0.38" @@ -964,6 +993,18 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" +[[package]] +name = "regex" +version = "1.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + [[package]] name = "reqwest" version = "0.11.27" diff --git a/Cargo.toml b/Cargo.toml index ddfd432..6ea9c05 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,7 @@ strip = true # Strip symbols from binary* [dependencies] chrono = { version = "0.4", features = ["serde"] } +env_logger = "0.7" serde = { version = "1.0", features = ["derive"] } clap = { version = "3", features = ["derive"] } oauth2 = { version = "4" } diff --git a/src/bin/sso/main.rs b/src/bin/sso/main.rs index 7d4150f..a5055ba 100644 --- a/src/bin/sso/main.rs +++ b/src/bin/sso/main.rs @@ -276,6 +276,8 @@ fn do_curl(profile: &Profile, mut args: Vec) -> Result<(), Box Result<(), Box> { + env_logger::init(); + let args: Args = Args::parse(); let command = args.command.unwrap_or(Commands::Login); -- cgit v1.2.3