Added environment variable ALFIS_DEBUG to set ALFIS to always run in debug mode.

This commit is contained in:
Revertron
2021-04-21 17:05:07 +02:00
parent 46226f8dc6
commit 04491e8558
2 changed files with 3 additions and 2 deletions
+2 -2
View File
@@ -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()