Crate quil [−] [src]
Quil is a easy to use library that supports message levels, multiple targets, and message contexts. Quil is thread safe and so it is possible to send loggers accross threads.
Examples
Basic example:
let logger = Logger::new(Console::new(), context!{ src: "root" }); logger.info("hello world");
Tue, 7 Nov 2017 23:55:42 +0000 - info: hello world src=root
Sub-context example:
let logger = Logger::new(Console::new(), context!{ src: "root", tag: "1" }); logger.info("hello"); let sub_logger = logger.ctx(context!{ tag: "", marker: "49" }); logger.info("world");
Tue, 7 Nov 2017 23:55:42 +0000 - info: hello src=root tag=1
Tue, 7 Nov 2017 23:55:42 +0000 - info: world src=root marker=49
Modules
prelude |
A convenience module that can be used to include commonly used quil types. |
targets |
Contains logger targets and the target trait for implementing custom targets |
Macros
context |
Creates a |
targets |
Creates a |
Structs
Context |
A logging context. |
Logger |
Logger has methods for logging messages from your program. This struct is the heart of Quil. Logger is clonable and can be send across threads safely. |
Enums
Level |
Log levels to be used with a |
Traits
Target |
Structs that implement |