Skip to content

Commit

Permalink
Merge pull request #108 from Stremio/feat/feature-to-enable-trace-log…
Browse files Browse the repository at this point in the history
…ging

Feat: Cargo feature to enable trace logging level
  • Loading branch information
tymmesyde committed Apr 29, 2024
2 parents c715b3a + 849cb81 commit 638daa4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

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

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ crate-type = ["cdylib"]
lto = true
opt-level = 's'

[features]
default = []
# enable TRACE level of logging in the crate using `tracing`.
log-trace = []

[dependencies]
stremio-core = { git = "https://github.com/Stremio/stremio-core", features = ["derive", "analytics"], branch = "development" }
serde = { version = "1.0.*", features = ["derive"] }
Expand Down
4 changes: 2 additions & 2 deletions src/stremio_core_web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ pub fn start() {
// This is not needed for tracing_wasm to work, but it is a common tool for getting proper error line numbers for panics.
console_error_panic_hook::set_once();

#[cfg(debug_assertions)]
#[cfg(any(debug_assertions, feature = "log-trace"))]
let max_level = Level::TRACE;
#[cfg(not(debug_assertions))]
#[cfg(all(not(debug_assertions), not(feature = "log-trace")))]
let max_level = Level::ERROR;

let config = WASMLayerConfigBuilder::default()
Expand Down

0 comments on commit 638daa4

Please sign in to comment.