Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@ aws-config = "0.52.0"
aws-sdk-sqs = "0.22.0"
clap = { version = "3.1.15", features = ["derive", "env"] }
futures = "0.3.25"
is-terminal = "0.4.3"
is-terminal = {version = "0.4.3", optional = true }
serde = "1.0"
spin-core = { git = "https://github.com/fermyon/spin", tag = "v2.3.1" }
spin-trigger = { git = "https://github.com/fermyon/spin", tag = "v2.3.1" }
tokio = { version = "1.23", features = ["full"] }
tokio-scoped = "0.2.0"
tracing = { version = "0.1", features = ["log"] }
tracing-subscriber = { version = "0.3.7", features = ["env-filter"] }
tracing-subscriber = { version = "0.3.7", features = ["env-filter"], optional = true }
wasmtime = { version = "18.0.1" }

[features]
tracing-subscriber = ["dep:tracing-subscriber", "dep:is-terminal"]
# By default, assume this project is used as a binary and a global tracing
# subscriber should be set up. If this project is used as a library to a program
# that already has a subscriber, the user can disable this feature.
default = ["tracing-subscriber"]
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

use clap::Parser;
#[cfg(feature = "tracing-subscriber")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively you can probably remove this dependency and use std::io::IsTerminal

use is_terminal::IsTerminal;
use trigger_sqs::SqsTrigger;
use spin_trigger::cli::TriggerExecutorCommand;
Expand All @@ -8,6 +8,8 @@ type Command = TriggerExecutorCommand<SqsTrigger>;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
// Conditionally initialize a tracing subscriber
#[cfg(feature = "tracing-subscriber")]
tracing_subscriber::fmt()
.with_writer(std::io::stderr)
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
Expand Down