Skip to content

Commit

Permalink
cln-plugin: Switch from env_logger to tracing-subscriber
Browse files Browse the repository at this point in the history
This switches the logging implementation from using the `log`-facade
to using the `tracing-subscriber` instead. This allows us to also tap
into the tracing instrumentation if desired, which was not possible
with `log`.

Changelog-Changed cln-plugin: The logging adapter now uses tracing-subscriber allowing the `tracing` ecosystem to be used. No format changes.
  • Loading branch information
cdecker committed Jan 16, 2024
1 parent 0d877ff commit 13aaf76
Show file tree
Hide file tree
Showing 3 changed files with 205 additions and 49 deletions.
124 changes: 113 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions plugins/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ path = "examples/cln-plugin-startup.rs"
[dependencies]
anyhow = "1.0.51"
bytes = "1.1.0"
log = { version = "0.4.14", features = ['std'] }
serde = { version = "1.0.131", features = ["derive"] }
log = { version = "^0.4", features = ['std'] }
serde = { version = "^1", features = ["derive"] }
serde_json = "1.0.72"
tokio-util = { version = "0.7", features = ["codec"] }
tokio = { version="1", features = ['io-std', 'rt', 'sync', 'macros', 'io-util'] }
tokio-stream = "0.1"
futures = "0.3"
env_logger = "0.10"
tracing-subscriber = { version = "^0.3", features = ["env-filter", "tracing"] }
tracing = { version = "^0.1", features = ["async-await", "log"] }

[dev-dependencies]
tokio = { version = "1", features = ["macros", "rt-multi-thread", ] }
Expand Down
Loading

0 comments on commit 13aaf76

Please sign in to comment.