mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 14:26:30 +03:00
Log more in tests
This commit is contained in:
@@ -42,14 +42,14 @@ pub(crate) fn test_context(callback: Option<Box<ContextCallback>>) -> TestContex
|
|||||||
/// specified in [test_context] but there is no callback hooked up,
|
/// specified in [test_context] but there is no callback hooked up,
|
||||||
/// i.e. [Context::call_cb] will always return `0`.
|
/// i.e. [Context::call_cb] will always return `0`.
|
||||||
pub(crate) fn dummy_context() -> TestContext {
|
pub(crate) fn dummy_context() -> TestContext {
|
||||||
test_context(None)
|
test_context(Some(Box::new(logging_cb)))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn logging_cb(_ctx: &Context, evt: Event) {
|
pub(crate) fn logging_cb(_ctx: &Context, evt: Event) {
|
||||||
match evt {
|
match evt {
|
||||||
Event::Info(msg) => println!("I: {}", msg),
|
Event::Info(msg) => println!("I: {}", msg),
|
||||||
Event::Warning(msg) => println!("W: {}", msg),
|
Event::Warning(msg) => eprintln!("=== WARNING ===\n{}\n===============", msg),
|
||||||
Event::Error(msg) => println!("E: {}", msg),
|
Event::Error(msg) => eprintln!("\n===================== ERROR =====================\n{}\n=================================================\n", msg),
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user