Changed log levels to make alfis less chatty.
This commit is contained in:
@@ -128,7 +128,7 @@ impl Chain {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_block(&mut self, block: Block) {
|
pub fn add_block(&mut self, block: Block) {
|
||||||
info!("Adding block:\n{:?}", &block);
|
debug!("Adding block:\n{:?}", &block);
|
||||||
self.blocks.push(block.clone());
|
self.blocks.push(block.clone());
|
||||||
self.last_block = Some(block.clone());
|
self.last_block = Some(block.clone());
|
||||||
if block.transaction.is_some() {
|
if block.transaction.is_some() {
|
||||||
@@ -278,7 +278,7 @@ impl Chain {
|
|||||||
Ok(mut statement) => {
|
Ok(mut statement) => {
|
||||||
while statement.next().unwrap() == State::Row {
|
while statement.next().unwrap() == State::Row {
|
||||||
let data = statement.read::<String>(0).unwrap();
|
let data = statement.read::<String>(0).unwrap();
|
||||||
info!("Got zone data {}", &data);
|
debug!("Got zone data {}", &data);
|
||||||
if let Ok(zone_data) = serde_json::from_str::<ZoneData>(&data) {
|
if let Ok(zone_data) = serde_json::from_str::<ZoneData>(&data) {
|
||||||
map.insert(zone_data.name.clone(), zone_data);
|
map.insert(zone_data.name.clone(), zone_data);
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -43,16 +43,16 @@ fn create_server_context(context: Arc<Mutex<Context>>, settings: &Settings) -> A
|
|||||||
if cfg!(target_os = "windows") {
|
if cfg!(target_os = "windows") {
|
||||||
if let Ok(root) = env::var("SYSTEMROOT") {
|
if let Ok(root) = env::var("SYSTEMROOT") {
|
||||||
let filename = format!("{}{}", &root, "\\System32\\drivers\\etc\\hosts");
|
let filename = format!("{}{}", &root, "\\System32\\drivers\\etc\\hosts");
|
||||||
info!("Loading hosts from '{}'", &filename);
|
debug!("Loading hosts from '{}'", &filename);
|
||||||
server_context.filters.push(Box::new(HostsFilter::new(&filename)));
|
server_context.filters.push(Box::new(HostsFilter::new(&filename)));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let filename = "/etc/hosts";
|
let filename = "/etc/hosts";
|
||||||
info!("Loading hosts from '{}'", filename);
|
debug!("Loading hosts from '{}'", filename);
|
||||||
server_context.filters.push(Box::new(HostsFilter::new(filename)));
|
server_context.filters.push(Box::new(HostsFilter::new(filename)));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
info!("Loading hosts from '{}'", &host);
|
debug!("Loading hosts from '{}'", &host);
|
||||||
server_context.filters.push(Box::new(HostsFilter::new(host)));
|
server_context.filters.push(Box::new(HostsFilter::new(host)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -120,7 +120,7 @@ impl Miner {
|
|||||||
match context.lock().unwrap().chain.last_block() {
|
match context.lock().unwrap().chain.last_block() {
|
||||||
None => {}
|
None => {}
|
||||||
Some(last_block) => {
|
Some(last_block) => {
|
||||||
info!("Last block found");
|
debug!("Last block found");
|
||||||
// If we were doing something else and got new block before we could mine this block
|
// If we were doing something else and got new block before we could mine this block
|
||||||
if last_block.index > job.block.index || last_block.hash != job.block.prev_block_hash {
|
if last_block.index > job.block.index || last_block.hash != job.block.prev_block_hash {
|
||||||
warn!("We missed block to lock");
|
warn!("We missed block to lock");
|
||||||
|
|||||||
+3
-3
@@ -91,7 +91,7 @@ impl Network {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if yggdrasil_only && !is_yggdrasil(&address.ip()) {
|
if yggdrasil_only && !is_yggdrasil(&address.ip()) {
|
||||||
info!("Dropping connection from Internet");
|
debug!("Dropping connection from Internet");
|
||||||
stream.shutdown(Shutdown::Both).unwrap_or_else(|e|{ warn!("Error in shutdown, {}", e); });
|
stream.shutdown(Shutdown::Both).unwrap_or_else(|e|{ warn!("Error in shutdown, {}", e); });
|
||||||
let _ = poll.registry().reregister(&mut server, SERVER, Interest::READABLE);
|
let _ = poll.registry().reregister(&mut server, SERVER, Interest::READABLE);
|
||||||
continue;
|
continue;
|
||||||
@@ -104,7 +104,7 @@ impl Network {
|
|||||||
stream.shutdown(Shutdown::Both).unwrap_or_else(|e|{ warn!("Error in shutdown, {}", e); });
|
stream.shutdown(Shutdown::Both).unwrap_or_else(|e|{ warn!("Error in shutdown, {}", e); });
|
||||||
warn!("Detected connection loop, ignoring IP: {}", &address.ip());
|
warn!("Detected connection loop, ignoring IP: {}", &address.ip());
|
||||||
} else {
|
} else {
|
||||||
info!("Accepted connection from: {} to local IP: {}", address, local_ip);
|
debug!("Accepted connection from: {} to local IP: {}", address, local_ip);
|
||||||
let token = next(&mut unique_token);
|
let token = next(&mut unique_token);
|
||||||
poll.registry().register(&mut stream, token, Interest::READABLE).expect("Error registering poll");
|
poll.registry().register(&mut stream, token, Interest::READABLE).expect("Error registering poll");
|
||||||
peers.add_peer(token, Peer::new(address, stream, State::Connected, true));
|
peers.add_peer(token, Peer::new(address, stream, State::Connected, true));
|
||||||
@@ -434,7 +434,7 @@ fn handle_message(context: Arc<Mutex<Context>>, message: Message, peers: &mut Pe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Message::Block { index, block } => {
|
Message::Block { index, block } => {
|
||||||
info!("Received block {}", index);
|
debug!("Received block {}", index);
|
||||||
let block: Block = match serde_json::from_str(&block) {
|
let block: Block = match serde_json::from_str(&block) {
|
||||||
Ok(block) => block,
|
Ok(block) => block,
|
||||||
Err(_) => return State::Error
|
Err(_) => return State::Error
|
||||||
|
|||||||
+1
-1
@@ -251,7 +251,7 @@ fn action_loaded(context: &Arc<Mutex<Context>>, web_view: &mut WebView<()>) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Event::BlockchainChanged {index} => {
|
Event::BlockchainChanged {index} => {
|
||||||
info!("Current blockchain height is {}", index);
|
debug!("Current blockchain height is {}", index);
|
||||||
if let Ok(zones) = serde_json::to_string(&context.chain.get_zones()) {
|
if let Ok(zones) = serde_json::to_string(&context.chain.get_zones()) {
|
||||||
let _ = handle.dispatch(move |web_view|{
|
let _ = handle.dispatch(move |web_view|{
|
||||||
web_view.eval(&format!("zonesChanged('{}');", &zones))
|
web_view.eval(&format!("zonesChanged('{}');", &zones))
|
||||||
|
|||||||
Reference in New Issue
Block a user