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
54
55
56
57
58
59
60
61
//! A logger to be used in build scripts.
//!
//! Allows logging through the [`log`] crate within a build script. Log messages are displayed as
//! [Cargo warning](https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargo-warning)
//! messages.
//!
//! ## Usage
//! To use `build_logger`, initialize it by calling [`init()`]. After this, using the [`log`]
//! crate's logging facade will display as warnings through Cargo.
//!
//! ```
//! //! build.rs
//!
//! fn main() {
//! build_logger::init().expect("could not initialize build_logger");
//!
//! log::info!("Hello, world!");
//! }
//! ```
use ;
;
static LOGGER: Logger = Logger;
/// Initialize the logger.
///
/// After calling this function, log messages created with the [`log`] crate will be displayed as
/// [Cargo warning](https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargo-warning)
/// messages.
///
/// ```
/// //! build.rs
///
/// fn main() {
/// build_logger::init().expect("could not initialize build_logger");
///
/// log::info!("Hello, world!");
/// }
/// ```