diff --git a/src/commons/constants.rs b/src/commons/constants.rs index c899008..cc3e61a 100644 --- a/src/commons/constants.rs +++ b/src/commons/constants.rs @@ -32,6 +32,7 @@ pub const MAX_RECONNECTS: u32 = 5; pub const CLASS_ZONE: &str = "zone"; pub const CLASS_DOMAIN: &str = "domain"; +pub const ALFIS_DEBUG: &str = "ALFIS_DEBUG"; /// Public nodes listen port pub const LISTEN_PORT: u16 = 4244; diff --git a/src/main.rs b/src/main.rs index 7428e02..6d37077 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,7 +16,7 @@ use simplelog::*; #[cfg(windows)] use winapi::um::wincon::{ATTACH_PARENT_PROCESS, AttachConsole, FreeConsole}; -use alfis::{Block, Bytes, Chain, Miner, Context, Network, Settings, dns_utils, Keystore, ZONE_DIFFICULTY}; +use alfis::{Block, Bytes, Chain, Miner, Context, Network, Settings, dns_utils, Keystore, ZONE_DIFFICULTY, ALFIS_DEBUG}; use std::fs::OpenOptions; use std::process::exit; use std::io::{Seek, SeekFrom}; @@ -153,7 +153,7 @@ fn main() { /// Sets up logger in accordance with command line options fn setup_logger(opt_matches: &Matches) { let mut level = LevelFilter::Info; - if opt_matches.opt_present("d") { + if opt_matches.opt_present("d") || env::var(ALFIS_DEBUG).is_ok() { level = LevelFilter::Trace; } let config = ConfigBuilder::new()