diff --git a/Cargo.lock b/Cargo.lock index f57e8c7..e4ceeeb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -100,18 +100,52 @@ dependencies = [ ] [[package]] -name = "android-tzdata" -version = "0.1.1" +name = "anstream" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] [[package]] -name = "android_system_properties" -version = "0.1.5" +name = "anstyle" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" + +[[package]] +name = "anstyle-parse" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ - "libc", + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" +dependencies = [ + "anstyle", + "windows-sys 0.59.0", ] [[package]] @@ -139,7 +173,7 @@ dependencies = [ "argh_shared", "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -163,12 +197,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" -[[package]] -name = "atomic" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" - [[package]] name = "autocfg" version = "1.4.0" @@ -230,7 +258,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.85", + "syn", ] [[package]] @@ -280,12 +308,6 @@ dependencies = [ "cipher", ] -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - [[package]] name = "byteorder" version = "1.5.0" @@ -349,20 +371,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "chrono" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "wasm-bindgen", - "windows-targets 0.52.6", -] - [[package]] name = "cipher" version = "0.4.4" @@ -385,6 +393,33 @@ dependencies = [ "libloading", ] +[[package]] +name = "colog" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c426b7af8d5e0ad79de6713996632ce31f0d68ba84068fb0d654b396e519df0" +dependencies = [ + "colored", + "env_logger", + "log", +] + +[[package]] +name = "colorchoice" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" + +[[package]] +name = "colored" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" +dependencies = [ + "lazy_static", + "windows-sys 0.48.0", +] + [[package]] name = "console" version = "0.15.8" @@ -419,12 +454,6 @@ dependencies = [ "futures", ] -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cpufeatures" version = "0.2.14" @@ -483,7 +512,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -530,7 +559,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -555,6 +584,29 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +[[package]] +name = "env_filter" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "env_logger" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "humantime", + "log", +] + [[package]] name = "errno" version = "0.3.9" @@ -696,7 +748,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -772,12 +824,6 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -[[package]] -name = "hermit-abi" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" - [[package]] name = "hex" version = "0.4.3" @@ -817,6 +863,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + [[package]] name = "i18n-config" version = "0.4.7" @@ -869,7 +921,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.85", + "syn", "unic-langid", ] @@ -883,38 +935,9 @@ dependencies = [ "i18n-config", "proc-macro2", "quote", - "syn 2.0.85", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", + "syn", ] -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "if_chain" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" - [[package]] name = "indenter" version = "0.3.3" @@ -957,15 +980,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b3f7cef34251886990511df1c61443aa928499d598a9473929ab5a90a527304" [[package]] -name = "is-terminal" -version = "0.4.13" +name = "is_terminal_polyfill" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.52.0", -] +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" @@ -982,15 +1000,6 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" -[[package]] -name = "js-sys" -version = "0.3.72" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" -dependencies = [ - "wasm-bindgen", -] - [[package]] name = "lazy_static" version = "1.5.0" @@ -1198,7 +1207,7 @@ checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -1299,7 +1308,7 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -1449,7 +1458,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.85", + "syn", "walkdir", ] @@ -1579,7 +1588,7 @@ checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -1644,41 +1653,7 @@ checksum = "0eb01866308440fc64d6c44d9e86c5cc17adfe33c4d6eed55da9145044d0ffc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", -] - -[[package]] -name = "spdlog-macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb877789e366d41c2afa9b764f638c5bf9cb23286969112bdb21b38a15de8d8d" -dependencies = [ - "nom", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "spdlog-rs" -version = "0.3.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ba5130aa47fc05c2643857ab6f948078e8ac9b10fbb2ffbb10872ad690d63b" -dependencies = [ - "arc-swap", - "atomic", - "cfg-if", - "chrono", - "if_chain", - "is-terminal", - "libc", - "once_cell", - "rustc_version", - "spdlog-macros", - "spin", - "static_assertions", - "thiserror", - "winapi", + "syn", ] [[package]] @@ -1686,9 +1661,6 @@ name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] [[package]] name = "spki" @@ -1700,12 +1672,6 @@ dependencies = [ "der", ] -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - [[package]] name = "strsim" version = "0.11.1" @@ -1718,17 +1684,6 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - [[package]] name = "syn" version = "2.0.85" @@ -1784,7 +1739,7 @@ checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -1824,7 +1779,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -1892,6 +1847,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + [[package]] name = "vaultix" version = "0.1.0" @@ -1899,19 +1860,20 @@ dependencies = [ "age", "argh", "blake3", + "colog", "console", "edit", "eyre", "hex", "hex-literal", "libc", + "log", "nom", "pinentry", "rpassword", "serde", "serde_json", "sha2", - "spdlog-rs", "subtle", "sys-mount", ] @@ -1938,61 +1900,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wasm-bindgen" -version = "0.2.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" -dependencies = [ - "cfg-if", - "once_cell", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.85", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.85", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" - [[package]] name = "which" version = "4.4.2" @@ -2005,22 +1912,6 @@ dependencies = [ "rustix", ] -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - [[package]] name = "winapi-util" version = "0.1.9" @@ -2030,21 +1921,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -2229,7 +2105,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -2249,5 +2125,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] diff --git a/Cargo.toml b/Cargo.toml index c06a168..66e8d7f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,19 +11,20 @@ path = "src/lib.rs" age = { git = "https://github.com/str4d/rage.git",rev = "baf277a749c839e49f93bffb58d36734ac94be83", features = ["ssh", "plugin"]} argh = "0.1.12" blake3 = "1.5.4" +colog = "1.3.0" console = "0.15.8" edit = "0.1.5" eyre = "0.6.12" hex = "0.4.3" hex-literal = "0.4.1" libc = "0.2.158" +log = "0.4.22" nom = "7.1.3" pinentry = "0.5.1" rpassword = "7.3.1" serde = "1.0.210" serde_json = "1.0.132" sha2 = "0.10.8" -spdlog-rs = "0.3.13" subtle = "2.6.1" sys-mount = "3.0.1" diff --git a/dev/test.nix b/dev/test.nix index 092bec9..131ef66 100644 --- a/dev/test.nix +++ b/dev/test.nix @@ -72,7 +72,7 @@ }; # for vm testing log - systemd.services.vaultix-activate.serviceConfig.Environment = [ "SPDLOG_RS_LEVEL=trace" ]; + systemd.services.vaultix-activate.serviceConfig.Environment = [ "RUST_LOG=trace" ]; } ) @@ -128,7 +128,7 @@ }; # for vm testing log - systemd.services.vaultix-activate.serviceConfig.Environment = [ "SPDLOG_RS_LEVEL=trace" ]; + systemd.services.vaultix-activate.serviceConfig.Environment = [ "RUST_LOG=trace" ]; }) ./configuration.nix @@ -172,7 +172,7 @@ }; # for vm testing log - systemd.services.vaultix-activate.serviceConfig.Environment = [ "SPDLOG_RS_LEVEL=trace" ]; + systemd.services.vaultix-activate.serviceConfig.Environment = [ "RUST_LOG=trace" ]; }) ./configuration.nix diff --git a/src/cmd/check.rs b/src/cmd/check.rs index daca0c6..1c8a879 100644 --- a/src/cmd/check.rs +++ b/src/cmd/check.rs @@ -1,5 +1,5 @@ use eyre::Result; -use spdlog::{debug, error}; +use log::{debug, error}; use crate::{ helper::stored::{InStore, SecMap, SecPath}, diff --git a/src/cmd/deploy.rs b/src/cmd/deploy.rs index b5b70ab..26abc8c 100644 --- a/src/cmd/deploy.rs +++ b/src/cmd/deploy.rs @@ -20,7 +20,7 @@ use age::Recipient; use eyre::{eyre, Context, ContextCompat, Result}; use hex::decode; use lib::extract_all_hashes; -use spdlog::{debug, error, info, trace}; +use log::{debug, error, info}; use sys_mount::{Mount, MountFlags, SupportedFilesystems}; impl HostKey { @@ -191,7 +191,7 @@ impl Profile { ret } else { if PathBuf::from($obj.path()).starts_with(&default_path) { - spdlog::warn!( + log::warn!( "extract to decryptedDir detected. recommend specify `name` instead of `path`." ); } @@ -256,7 +256,7 @@ impl Profile { }) .for_each(|(k, v)| { // render and insert - trace!("template before process: {}", template); + log::trace!("template before process: {}", template); let raw_composed_insertial = String::from_utf8_lossy(v).to_string(); @@ -290,11 +290,6 @@ impl Profile { } else { self.decrypted_dir() }; - info!( - "link decrypted dir {} to {}", - target_extract_dir_with_gen.display(), - symlink_dst - ); match std::fs::remove_file(symlink_dst) { Err(e) if e.kind() == io::ErrorKind::NotFound => {} @@ -303,7 +298,12 @@ impl Profile { debug!("old symlink removed"); } } - // link back to /run/vaultix* + + info!( + "linking decrypted dir {} to {}", + target_extract_dir_with_gen.display(), + symlink_dst + ); std::os::unix::fs::symlink(target_extract_dir_with_gen, symlink_dst) .wrap_err_with(|| "create symlink error") } diff --git a/src/cmd/edit.rs b/src/cmd/edit.rs index 8ae5334..cd2ec88 100644 --- a/src/cmd/edit.rs +++ b/src/cmd/edit.rs @@ -14,8 +14,8 @@ use crate::helper::{ use age::Recipient; use eyre::{eyre, Context, ContextCompat}; +use log::info; use nom::AsBytes; -use spdlog::info; use super::EditSubCmd; diff --git a/src/cmd/mod.rs b/src/cmd/mod.rs index 059ad9c..fd0ff47 100644 --- a/src/cmd/mod.rs +++ b/src/cmd/mod.rs @@ -1,7 +1,7 @@ use std::{fs, path::PathBuf}; use eyre::{eyre, Context, ContextCompat}; -use spdlog::prelude::*; +use log::{debug, info}; use {argh::FromArgs, std::fmt::Debug}; mod check; diff --git a/src/cmd/renc.rs b/src/cmd/renc.rs index 40c3c28..5035760 100644 --- a/src/cmd/renc.rs +++ b/src/cmd/renc.rs @@ -1,5 +1,5 @@ use eyre::{eyre, Context, Result}; -use spdlog::{debug, error, info}; +use log::{debug, error, info}; use std::{fs, path::PathBuf}; use crate::{ diff --git a/src/helper/secret_buf.rs b/src/helper/secret_buf.rs index 79c3363..a685d4b 100644 --- a/src/helper/secret_buf.rs +++ b/src/helper/secret_buf.rs @@ -6,8 +6,6 @@ use std::rc::Rc; use std::{io::Read, iter, marker::PhantomData}; use age::{Identity, Recipient}; -use spdlog::debug; - #[derive(Debug, Clone)] pub struct AgeEnc; #[derive(Debug, Clone)] @@ -71,6 +69,7 @@ impl SecBuf { } } use eyre::eyre; +use log::debug; use super::set_owner_group; diff --git a/src/helper/set_owner_group.rs b/src/helper/set_owner_group.rs index 7afbab2..95d4f3a 100644 --- a/src/helper/set_owner_group.rs +++ b/src/helper/set_owner_group.rs @@ -1,6 +1,6 @@ use eyre::{eyre, Result}; use libc::{fchown, getgrnam, getpwnam}; -use spdlog::warn; +use log::warn; use std::{ffi::CString, fs::File, os::fd::AsRawFd}; pub fn set_owner_and_group(file: &File, owner: &str, group: &str) -> Result<()> { diff --git a/src/helper/stored.rs b/src/helper/stored.rs index 8b16185..e63ce19 100644 --- a/src/helper/stored.rs +++ b/src/helper/stored.rs @@ -7,15 +7,14 @@ use std::{ rc::Rc, }; -use age::{Identity, Recipient}; -use eyre::Context; -use spdlog::{debug, trace}; - use crate::{ helper::secret_buf::{AgeEnc, SecBuf}, profile::{self, Secret, SecretSet}, }; +use age::{Identity, Recipient}; +use eyre::Context; use eyre::{eyre, Result}; +use log::{debug, trace}; use std::marker::PhantomData; use super::secret_buf::HostEnc; diff --git a/src/main.rs b/src/main.rs index ea4b2da..bd37756 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,26 +1,15 @@ #![feature(iterator_try_collect)] use cmd::Args; use eyre::Result; -use spdlog::formatter::{pattern, PatternFormatter}; mod cmd; mod helper; mod interop; mod parser; mod profile; -use std::os::unix::process::parent_id; fn main() -> Result<()> { - let _ = spdlog::init_env_level(); - let as_sd_unit = parent_id() == 1; - if as_sd_unit { - for sink in spdlog::default_logger().sinks() { - sink.set_formatter(Box::new(PatternFormatter::new(pattern!( - "{^{level}} - {payload}{eol}" - )))) - } - spdlog::debug!("Detected running as systemd unit"); - } + colog::init(); let args: Args = argh::from_env(); args.ayaya() }