Skip to content

Commit c374d15

Browse files
authored
Merge pull request #58 from xeptore/patch-1
Improve documentation
2 parents 02a1a1d + 8914cd0 commit c374d15

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,44 +28,44 @@ fn main() {
2828

2929
This outputs:
3030

31-
```
31+
```txt
3232
2022-01-19T17:27:07.013874956Z WARN [logging_example] This is an example message.
3333
```
3434

3535
You can run the above example with:
3636

37-
```bash
37+
```sh
3838
cargo run --example init
3939
```
4040

4141
Coloured output and timestamps will be enabled by default. You can remove these
4242
features and their respective dependencies by disabling all features in your
4343
`Cargo.toml`.
4444

45-
```
45+
```toml
4646
[dependencies.simple_logger]
4747
default-features = false
4848
```
4949

5050
To include the `timestamps` feature, but not the `colors` feature:
5151

52-
```
52+
```toml
5353
[dependencies.simple_logger]
5454
default-features = false
5555
features = ["timestamps"]
5656
```
5757

5858
To include the `colors` feature, but not the `timestamps` feature:
5959

60-
```
60+
```toml
6161
[dependencies.simple_logger]
6262
default-features = false
6363
features = ["colors"]
6464
```
6565

6666
To direct logging output to `stderr` use the `stderr` feature:
6767

68-
```
68+
```toml
6969
[dependencies.simple_logger]
7070
features = ["stderr"]
7171
```

src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//!
33
//! Optional features include timestamps, colored output and logging to stderr.
44
//!
5-
//! ```
5+
//! ```rust
66
//! simple_logger::SimpleLogger::new().env().init().unwrap();
77
//!
88
//! log::warn!("This is an example message.");
@@ -12,19 +12,19 @@
1212
//!
1313
//! Just initialize logging without any configuration:
1414
//!
15-
//! ```
15+
//! ```rust
1616
//! simple_logger::init().unwrap();
1717
//! ```
1818
//!
1919
//! Set the log level from the `RUST_LOG` environment variable:
2020
//!
21-
//! ```
21+
//! ```rust
2222
//! simple_logger::init_with_env().unwrap();
2323
//! ```
2424
//!
2525
//! Hardcode a default log level:
2626
//!
27-
//! ```
27+
//! ```rust
2828
//! simple_logger::init_with_level(log::Level::Warn).unwrap();
2929
//! ```
3030
@@ -488,15 +488,15 @@ fn set_up_color_terminal() {
488488
}
489489
}
490490

491-
/// Initialise the logger with it's default configuration.
491+
/// Initialise the logger with its default configuration.
492492
///
493493
/// Log messages will not be filtered.
494494
/// The `RUST_LOG` environment variable is not used.
495495
pub fn init() -> Result<(), SetLoggerError> {
496496
SimpleLogger::new().init()
497497
}
498498

499-
/// Initialise the logger with it's default configuration.
499+
/// Initialise the logger with its default configuration.
500500
///
501501
/// Log messages will not be filtered.
502502
/// The `RUST_LOG` environment variable is not used.

0 commit comments

Comments
 (0)