From 1da4bb611f8422422342d81fef6043a4ab7787b1 Mon Sep 17 00:00:00 2001 From: Alberto Coscia Date: Sun, 22 Jul 2018 15:45:33 +0200 Subject: [PATCH] Avoid including env_logger in release builds --- src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index bea2e66..249896c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,6 +4,8 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +// We don't need debug logs in release builds +#[cfg(debug_assertions)] extern crate env_logger; // TODO env_logger may not be a good fit #[macro_use] extern crate structopt; @@ -37,8 +39,8 @@ use cli::args::{match_args, Sigil}; use structopt::StructOpt; fn main() { - env_logger::init(); - tracepoint!(); + // We don't need debug logs in release builds + #[cfg(debug_assertions)] env_logger::init(); // Parse CLI arguments let sigil = Sigil::from_args(); // Match them with a subcommand and run it