Skip to content

Commit

Permalink
logger: remove json-log event queue
Browse files Browse the repository at this point in the history
  • Loading branch information
bmwill authored and bors-libra committed Dec 17, 2021
1 parent 50f9c74 commit f1a2ba1
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 103 deletions.
7 changes: 0 additions & 7 deletions consensus/src/block_storage/block_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use diem_crypto::HashValue;
use diem_logger::prelude::*;
use diem_types::{block_info::BlockInfo, ledger_info::LedgerInfoWithSignatures};
use mirai_annotations::{checked_verify_eq, precondition};
use short_hex_str::AsShortHexStr;
use std::{
collections::{vec_deque::VecDeque, HashMap, HashSet},
sync::Arc,
Expand Down Expand Up @@ -448,12 +447,6 @@ impl BlockTree {
committed_round = committed_round,
block_id = block_to_commit.id(),
);
event!("committed",
"block_id": block_to_commit.id().short_str(),
"epoch": block_to_commit.epoch(),
"round": committed_round,
"parent_id": block_to_commit.parent_id().short_str(),
);

let id_to_remove = self.find_blocks_to_prune(block_to_commit.id());
if let Err(e) = storage.prune_tree(id_to_remove.clone().into_iter().collect()) {
Expand Down
19 changes: 0 additions & 19 deletions crates/debug-interface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// SPDX-License-Identifier: Apache-2.0

use anyhow::Result;
use diem_logger::json_log::JsonLogEntry;
use reqwest::{blocking, Url};
use std::collections::HashMap;

Expand Down Expand Up @@ -79,14 +78,6 @@ impl NodeDebugClient {
})
.collect()
}

pub fn get_events(&self) -> Result<Vec<JsonLogEntry>> {
let mut url = self.url.clone();
url.set_path("events");
let response = self.client.get(url).send()?;

Ok(response.json()?)
}
}

/// Implement default utility client for AsyncNodeDebugInterface
Expand Down Expand Up @@ -129,14 +120,4 @@ impl AsyncNodeDebugClient {
})
.collect()
}

pub async fn get_events(&mut self) -> Result<Vec<JsonLogEntry>> {
let response = self
.client
.get(&format!("{}/events", self.addr))
.send()
.await?;

Ok(response.json().await?)
}
}
7 changes: 2 additions & 5 deletions crates/debug-interface/src/node_debug_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! Debug interface to access information in a specific node.
use diem_config::config::NodeConfig;
use diem_logger::{info, json_log, Filter, Logger};
use diem_logger::{info, Filter, Logger};
use diem_metrics::json_metrics::get_git_rev;
use serde::{Deserialize, Serialize};
use std::{net::SocketAddr, sync::Arc};
Expand Down Expand Up @@ -36,9 +36,6 @@ impl NodeDebugService {
let metrics =
warp::path("metrics").map(|| warp::reply::json(&diem_metrics::get_all_metrics()));

// GET /events
let events = warp::path("events").map(|| warp::reply::json(&json_log::pop_last_entries()));

// Post /log/filter
let local_filter = {
let logger = logger.clone();
Expand Down Expand Up @@ -83,7 +80,7 @@ impl NodeDebugService {
};
let node_info_route = warp::path("node-info").map(move || warp::reply::json(&node_info));

let routes = log.or(warp::get().and(metrics.or(events).or(node_info_route)));
let routes = log.or(warp::get().and(metrics.or(node_info_route)));

runtime
.handle()
Expand Down
70 changes: 0 additions & 70 deletions crates/diem-logger/src/json_log.rs

This file was deleted.

3 changes: 1 addition & 2 deletions crates/diem-logger/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,12 @@ pub mod prelude {
pub use crate::{
debug,
diem_logger::FileWriter,
error, event, info, sample,
error, info, sample,
sample::{SampleRate, Sampling},
security::SecurityEvent,
trace, warn,
};
}
pub mod json_log;

mod diem_logger;
mod event;
Expand Down

0 comments on commit f1a2ba1

Please sign in to comment.