From ac61196fc65a44736a9c5bfc55e33b693383a375 Mon Sep 17 00:00:00 2001 From: Dave Hrycyszyn Date: Wed, 22 Jan 2020 16:34:42 +0000 Subject: [PATCH] all: initializing logger at start --- mixnode/src/main.rs | 2 ++ sfw-provider/src/main.rs | 2 ++ validator/src/main.rs | 9 --------- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/mixnode/src/main.rs b/mixnode/src/main.rs index ee05378043..6a466f67f2 100644 --- a/mixnode/src/main.rs +++ b/mixnode/src/main.rs @@ -5,6 +5,8 @@ mod mix_peer; mod node; fn main() { + pretty_env_logger::init(); + let arg_matches = App::new("Nym Mixnode") .version(built_info::PKG_VERSION) .author("Nymtech") diff --git a/sfw-provider/src/main.rs b/sfw-provider/src/main.rs index 9e55332ca1..e0efaa480c 100644 --- a/sfw-provider/src/main.rs +++ b/sfw-provider/src/main.rs @@ -8,6 +8,8 @@ use std::process; pub mod provider; fn main() { + pretty_env_logger::init(); + let arg_matches = App::new("Nym Service Provider") .version(built_info::PKG_VERSION) .author("Nymtech") diff --git a/validator/src/main.rs b/validator/src/main.rs index ea7b2679a2..8b8503cc91 100644 --- a/validator/src/main.rs +++ b/validator/src/main.rs @@ -1,7 +1,6 @@ use crate::validator::config::Config; use crate::validator::Validator; use clap::{App, Arg, ArgMatches, SubCommand}; -use dotenv; use log::{error, trace}; use std::process; use toml; @@ -9,14 +8,6 @@ use toml; mod validator; fn main() { - // load environment variables from .env file - if dotenv::dotenv().is_err() { - eprint!("failed to read .env file - the logging is unlikely to work correctly") - } - - // if we want to log to file or use different logger, we'd need to replace it here. - // a better alternative, but way more complex would be `slog` crate - we should - // perhaps research it at some point. pretty_env_logger::init(); let arg_matches = App::new("Nym Validator")