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 Context from a varying set of keys and values.

targets

Creates a TargetSet from a varying set of targets. TargetSet allows the logger to log to more than a single target at once.

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 Logger.

Traits

Target

Structs that implement Target can be used with Logger.