Standardize logging and error handling

- Introduce new types: LoggedResult and LoggedError
- Introduce new extension methods to log and add additional msgs
- Never exit when logging error messages in Rust (all errors should be
  handled by using Result and Rust's error propagation)
- Remove all usages of anyhow as it doesn't fit Magisk's use cases
This commit is contained in:
topjohnwu
2023-06-29 16:44:44 -07:00
parent dbc2236dd2
commit 4ee4cbada6
16 changed files with 254 additions and 145 deletions
-9
View File
@@ -20,12 +20,6 @@ dependencies = [
"winapi",
]
[[package]]
name = "anyhow"
version = "1.0.71"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8"
[[package]]
name = "argh"
version = "0.1.10"
@@ -75,7 +69,6 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
name = "base"
version = "0.0.0"
dependencies = [
"anyhow",
"cfg-if",
"cxx",
"cxx-gen",
@@ -222,7 +215,6 @@ dependencies = [
name = "magiskboot"
version = "0.0.0"
dependencies = [
"anyhow",
"argh",
"base",
"byteorder",
@@ -247,7 +239,6 @@ dependencies = [
name = "magiskpolicy"
version = "0.0.0"
dependencies = [
"anyhow",
"base",
"cxx",
"cxx-gen",