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
+1
View File
@@ -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;
+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()