2014-12-13 21:49:39 +00:00
|
|
|
log
|
|
|
|
===
|
|
|
|
|
2015-01-25 06:44:46 +00:00
|
|
|
A Rust library providing a lightweight logging *facade*.
|
2014-12-13 21:49:39 +00:00
|
|
|
|
|
|
|
[![Build Status](https://travis-ci.org/rust-lang/log.svg?branch=master)](https://travis-ci.org/rust-lang/log)
|
|
|
|
|
|
|
|
[Documentation](http://doc.rust-lang.org/log)
|
|
|
|
|
2015-01-25 06:44:46 +00:00
|
|
|
A logging facade provides a single logging API that abstracts over the actual
|
|
|
|
logging implementation. Libraries can use the logging API provided by this
|
|
|
|
crate, and the consumer of those libraries can choose the logging
|
|
|
|
implementation that is most suitable for its use case.
|
|
|
|
|
|
|
|
Libraries should simply depend on the `log` crate, using the various logging
|
|
|
|
macros as they like. Applications should choose a logging implementation that
|
|
|
|
will process all logging messages.
|
|
|
|
|
2014-12-13 21:49:39 +00:00
|
|
|
## Usage
|
|
|
|
|
|
|
|
Add this to your `Cargo.toml`:
|
|
|
|
|
|
|
|
```toml
|
|
|
|
[dependencies]
|
2015-01-25 06:44:46 +00:00
|
|
|
log = "0.2"
|
2014-12-13 21:49:39 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
and this to your crate root:
|
|
|
|
|
|
|
|
```rust
|
2015-01-25 06:44:46 +00:00
|
|
|
#[macro_use]
|
2014-12-13 21:49:39 +00:00
|
|
|
extern crate log;
|
|
|
|
```
|