Commit 54228363 authored by Constantin Berhard's avatar Constantin Berhard
Browse files


parent bb1b3927
//! The logger module fills in the logging facade `log`
use log;
use log::{LogRecord, LogLevel, LogMetadata, SetLoggerError, LogLevelFilter};
......@@ -7,6 +8,7 @@ struct Logger {
emaillevel: LogLevel,
/// Initializes logging. Do this before using any logging macros (e.g. `warn!`)
pub fn init() -> Result<(), SetLoggerError> {
log::set_logger(|max_log_level| {
//! This module traces actions of the brain to check its sanity for testing purposes
use std::fmt::Debug;
use std::any::Any;
// TODO: reexport the mods under nice names
mod events;
mod book_keeper;
/// An event of some kind, that can be compared to other `TestableEvent`s for testing
/// and has a `Debug` implementation for human debugging with the logger.
pub trait TestableEvent: Debug + Any {
/// tests deeply for equality, unboxing the argument first
fn obj_equals(&self, other: Box<Any>) -> bool;
......@@ -11,11 +17,11 @@ pub trait TestableEvent: Debug + Any {
/// It is used for testing, to check that the correct actor is activated.
pub enum ActorType {
/// the actor for the green LED
/// the actor for the electric door locking mechanism
/// the actor which can buzz open the building door
pub mod events;
mod book_keeper;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment