From 44f1cfd2484794acb98df3eacd2e78fef0a038c1 Mon Sep 17 00:00:00 2001 From: "Aode (Lion)" Date: Sun, 30 Jan 2022 17:07:41 -0600 Subject: [PATCH] Put console behind feature --- Cargo.toml | 6 +++++- src/main.rs | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 013bdaf..2084861 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,12 +11,16 @@ build = "src/build.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[features] +default = [] +console = ["console-subscriber"] + [dependencies] actix-rt = "2.3.0" actix-web = { version = "4.0.0-beta.21", default-features = false } awc = { version = "3.0.0-beta.19", default-features = false } bcrypt = "0.10" -console-subscriber = "0.1" +console-subscriber = { version = "0.1", optional = true } mime = "0.3" minify-html = "0.8.0" opentelemetry = { version = "0.16", features = ["rt-tokio"] } diff --git a/src/main.rs b/src/main.rs index a4aad18..04a55af 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,6 @@ use actix_web::{App, HttpServer}; use awc::Client; +#[cfg(feature = "console")] use console_subscriber::ConsoleLayer; use opentelemetry::{ sdk::{propagation::TraceContextPropagator, Resource}, @@ -62,6 +63,7 @@ fn init_logger(opentelemetry_url: Option<&Url>) -> Result<(), Box) -> Result<(), Box