Added environment variable ALFIS_DEBUG to set ALFIS to always run in debug mode.
This commit is contained in:
@@ -32,6 +32,7 @@ pub const MAX_RECONNECTS: u32 = 5;
|
|||||||
|
|
||||||
pub const CLASS_ZONE: &str = "zone";
|
pub const CLASS_ZONE: &str = "zone";
|
||||||
pub const CLASS_DOMAIN: &str = "domain";
|
pub const CLASS_DOMAIN: &str = "domain";
|
||||||
|
pub const ALFIS_DEBUG: &str = "ALFIS_DEBUG";
|
||||||
|
|
||||||
/// Public nodes listen port
|
/// Public nodes listen port
|
||||||
pub const LISTEN_PORT: u16 = 4244;
|
pub const LISTEN_PORT: u16 = 4244;
|
||||||
|
|||||||
+2
-2
@@ -16,7 +16,7 @@ use simplelog::*;
|
|||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
use winapi::um::wincon::{ATTACH_PARENT_PROCESS, AttachConsole, FreeConsole};
|
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::fs::OpenOptions;
|
||||||
use std::process::exit;
|
use std::process::exit;
|
||||||
use std::io::{Seek, SeekFrom};
|
use std::io::{Seek, SeekFrom};
|
||||||
@@ -153,7 +153,7 @@ fn main() {
|
|||||||
/// Sets up logger in accordance with command line options
|
/// Sets up logger in accordance with command line options
|
||||||
fn setup_logger(opt_matches: &Matches) {
|
fn setup_logger(opt_matches: &Matches) {
|
||||||
let mut level = LevelFilter::Info;
|
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;
|
level = LevelFilter::Trace;
|
||||||
}
|
}
|
||||||
let config = ConfigBuilder::new()
|
let config = ConfigBuilder::new()
|
||||||
|
|||||||
Reference in New Issue
Block a user