feat: enable updater logging on windows (#256)

This commit is contained in:
Bryan Oltman
2024-12-18 17:10:37 -05:00
committed by GitHub
parent a6c761f50f
commit 38aadee1c5
3 changed files with 87 additions and 2 deletions
Generated
+77 -1
View File
@@ -1,6 +1,6 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
version = 4
[[package]]
name = "addr2line"
@@ -350,6 +350,15 @@ dependencies = [
"syn 1.0.109",
]
[[package]]
name = "deranged"
version = "0.3.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4"
dependencies = [
"powerfmt",
]
[[package]]
name = "digest"
version = "0.10.7"
@@ -983,6 +992,12 @@ dependencies = [
"tokio",
]
[[package]]
name = "num-conv"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
[[package]]
name = "num-traits"
version = "0.2.17"
@@ -1002,6 +1017,15 @@ dependencies = [
"libc",
]
[[package]]
name = "num_threads"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9"
dependencies = [
"libc",
]
[[package]]
name = "object"
version = "0.32.1"
@@ -1095,6 +1119,12 @@ dependencies = [
"crossbeam-channel",
]
[[package]]
name = "powerfmt"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
[[package]]
name = "ppv-lite86"
version = "0.2.17"
@@ -1596,6 +1626,18 @@ version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32fea41aca09ee824cc9724996433064c89f7777e60762749a4170a14abbfa21"
[[package]]
name = "simple_logger"
version = "5.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8c5dfa5e08767553704aa0ffd9d9794d527103c736aba9854773851fd7497eb"
dependencies = [
"colored",
"log",
"time",
"windows-sys 0.48.0",
]
[[package]]
name = "slab"
version = "0.4.9"
@@ -1741,6 +1783,39 @@ dependencies = [
"syn 2.0.89",
]
[[package]]
name = "time"
version = "0.3.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21"
dependencies = [
"deranged",
"itoa",
"libc",
"num-conv",
"num_threads",
"powerfmt",
"serde",
"time-core",
"time-macros",
]
[[package]]
name = "time-core"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
[[package]]
name = "time-macros"
version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de"
dependencies = [
"num-conv",
"time-core",
]
[[package]]
name = "tinyvec"
version = "1.6.0"
@@ -1919,6 +1994,7 @@ dependencies = [
"serde_yaml",
"serial_test",
"sha2",
"simple_logger",
"tempdir",
"zip",
]
+3
View File
@@ -64,6 +64,9 @@ log-panics = { version = "2", features = ["with-backtrace"] }
# Support for logging on iOS (https://developer.apple.com/documentation/oslog)
oslog = "0.2.0"
[target.'cfg(target_os = "windows")'.dependencies]
simple_logger = "5.0.0"
[dev-dependencies]
mockall = "0.12.1"
mockito = "1.2.0"
+7 -1
View File
@@ -22,10 +22,16 @@ pub fn init_logging() {
}
}
#[cfg(target_os = "windows")]
pub fn init_logging() {
let _ = simple_logger::SimpleLogger::new().init();
}
#[cfg(all(
not(target_os = "android"),
not(target_os = "ios"),
not(target_os = "macos")
not(target_os = "macos"),
not(target_os = "windows")
))]
pub fn init_logging() {
// Nothing to do on non-Android, non-iOS platforms.