Skip to content

Commit

Permalink
fix: swap no-logging feature for logging feature
Browse files Browse the repository at this point in the history
Having a subtractive feature like no-logging was causing compile errors to be
missed in CI, which is not good.
  • Loading branch information
obmarg committed May 23, 2024
1 parent 0f744be commit 3d4837c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ members = ["examples", "examples-wasm"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
default = []
default = ["logging"]
logging = ["dep:log"]
async-tungstenite = ["tungstenite"]
client-cynic = ["cynic"]
client-graphql-client = ["graphql_client"]
ws_stream_wasm = ["dep:ws_stream_wasm", "no-logging", "pharos", "pin-project-lite"]
no-logging = []
ws_stream_wasm = ["dep:ws_stream_wasm", "pharos", "pin-project-lite"]

[dependencies]
async-trait = "0.1"
futures = "0.3"
log = "0.4"
log = { version = "0.4", optional = true }
pin-project = "1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand Down
8 changes: 4 additions & 4 deletions src/logging.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
#[cfg(not(feature = "no-logging"))]
#[cfg(all(feature = "logging", not(target_arch = "wasm32")))]
macro_rules! trace {
($($arg:tt)+) => (
log::trace!(target: "graphql-ws-client", $($arg)+)
)
}

#[cfg(feature = "no-logging")]
#[cfg(any(not(feature = "logging"), target_arch = "wasm32"))]
macro_rules! trace {
($($t:tt)*) => {};
}

#[cfg(not(feature = "no-logging"))]
#[cfg(all(feature = "logging", not(target_arch = "wasm32")))]
#[allow(unused_macros)]
macro_rules! warning {
($($arg:tt)+) => (
log::warn!(target: "graphql-ws-client", $($arg)+)
)
}

#[cfg(feature = "no-logging")]
#[cfg(any(not(feature = "logging"), target_arch = "wasm32"))]
#[allow(unused_macros)]
macro_rules! warning {
($($t:tt)*) => {};
Expand Down

0 comments on commit 3d4837c

Please sign in to comment.