Commit 54228363 authored by Constantin Berhard's avatar Constantin Berhard

comments!

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| {
max_log_level.set(LogLevelFilter::Debug);
......
//! 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.
#[derive(Copy,Clone,Debug,PartialEq,Eq)]
pub enum ActorType {
/// the actor for the green LED
GreenLed,
/// the actor for the electric door locking mechanism
Lock,
/// the actor which can buzz open the building door
Buzz,
}
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