Skip to content

Commit 3833ae9

Browse files
Implement a logging facade
1 parent 9e7b6b8 commit 3833ae9

File tree

10 files changed

+1353
-0
lines changed

10 files changed

+1353
-0
lines changed

Cargo.lock

Lines changed: 213 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ members = [
1616
"litebox_shim_linux",
1717
"litebox_syscall_rewriter",
1818
"litebox_runner_snp",
19+
"litebox_util_log",
20+
"litebox_util_log_macros",
1921
# The CI tests are not meant to be released (thus are not prefixed with
2022
# `litebox_`), but exist purely to better manage development on LiteBox.
2123
"dev_tests",
@@ -35,6 +37,8 @@ default-members = [
3537
"litebox_shim_linux",
3638
"litebox_shim_optee",
3739
"litebox_syscall_rewriter",
40+
"litebox_util_log",
41+
"litebox_util_log_macros",
3842
"dev_tests",
3943
"dev_bench",
4044
]

litebox_util_log/Cargo.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[package]
2+
name = "litebox_util_log"
3+
version = "0.1.0"
4+
edition = "2024"
5+
description = "Logging facade for LiteBox that supports multiple backends"
6+
7+
[features]
8+
default = ["backend_log"]
9+
backend_log = ["dep:log", "log/kv"]
10+
backend_tracing = ["dep:tracing"]
11+
12+
# Key-value capture features (mirrors log's kv features)
13+
kv_std = ["log?/kv_std"]
14+
kv_sval = ["log?/kv_sval"]
15+
kv_serde = ["log?/kv_serde"]
16+
17+
[dependencies]
18+
log = { version = "0.4", optional = true, default-features = false }
19+
tracing = { version = "0.1", optional = true, default-features = false }
20+
litebox_util_log_macros = { path = "../litebox_util_log_macros" }
21+
22+
[dev-dependencies]
23+
env_logger = { version = "0.11", features = ["unstable-kv"] }
24+
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
25+
26+
[lints]
27+
workspace = true

0 commit comments

Comments
 (0)