1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! An example deferred logger with example flusher.
//!
//! It is included here for documentation purposes only.
//!
//! Do ensure that the `example` feature is not active in production!
//!
//! ```
//! pub struct StderrFlusher {}
//!
//! impl crate::Flusher for StderrFlusher {
//! fn flush(&self, logs: &str) {
//! print!("{}", logs);
//! }
//! }
//!
//! delog!(Delogger, 256, StderrFlusher);
//! static FLUSHER: StderrFlusher = StderrFlusher {};
//! Delogger::init(log::LevelFilter::Info, &STDOUT_FLUSHER).ok();
//!
//! warn!("This is a warning");
//! info_now!("This is IMMEDIATE information");
//! info!("twenty-four bits '{}'", delog::hex_str!(&[0xa1u8, 0xfF, 0x03]));
//!
//! Delogger::flush();
//! ```
// use crate::flushers::StderrFlusher;
use crateDefaultRenderer;
/// Flushes logs to stderr.
/// Flushes logs to stdout.
cratedelog!;
// #[macro_export]
// crate::generate_macros!();