mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-16 20:39:10 +00:00
Fix range sync tests
This commit is contained in:
@@ -34,7 +34,9 @@ use rand::Rng;
|
||||
use rand::SeedableRng;
|
||||
use rayon::prelude::*;
|
||||
use sensitive_url::SensitiveUrl;
|
||||
use slog::Logger;
|
||||
use slog::{o, Drain, Logger};
|
||||
use slog_async::Async;
|
||||
use slog_term::{FullFormat, TermDecorator};
|
||||
use slot_clock::{SlotClock, SystemTimeSlotClock, TestingSlotClock};
|
||||
use state_processing::per_block_processing::compute_timestamp_at_slot;
|
||||
use state_processing::{
|
||||
@@ -72,7 +74,6 @@ pub type DiskHarnessType<E, TSlotClock> = BaseHarnessType<E, LevelDB<E>, LevelDB
|
||||
|
||||
pub type EphemeralHarnessType<E, TSlotClock> =
|
||||
BaseHarnessType<E, MemoryStore<E>, MemoryStore<E>, TSlotClock>;
|
||||
|
||||
pub type EphemeralTestingSlotClockHarnessType<E> =
|
||||
BaseHarnessType<E, MemoryStore<E>, MemoryStore<E>, TestingSlotClock>;
|
||||
pub type EphemeralSystemTimeSlotClockHarnessType<E> =
|
||||
@@ -2129,3 +2130,15 @@ impl<T: BeaconChainTypes> fmt::Debug for BeaconChainHarness<T> {
|
||||
write!(f, "BeaconChainHarness")
|
||||
}
|
||||
}
|
||||
|
||||
pub fn build_log(level: slog::Level, enabled: bool) -> Logger {
|
||||
let decorator = TermDecorator::new().build();
|
||||
let drain = FullFormat::new(decorator).build().fuse();
|
||||
let drain = Async::new(drain).build().fuse();
|
||||
|
||||
if enabled {
|
||||
Logger::root(drain.filter_level(level).fuse(), o!())
|
||||
} else {
|
||||
Logger::root(drain.filter(|_| false).fuse(), o!())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user