Skip to content

Commit 73590c9

Browse files
committed
fix README, which is controlled by lib.rs
1 parent 1cece63 commit 73590c9

2 files changed

Lines changed: 33 additions & 4 deletions

File tree

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,17 @@ Starting with v0.10 `tui-logger` is `ratatui` only.
4040
- [X] `slog` support, providing a Drain to integrate into your `slog` infrastructure
4141
- [X] `tracing` support
4242
- [X] Support to use custom formatter for log events
43+
- [X] Configurable by environment variables
4344
- [ ] Allow configuration of target dependent loglevel specifically for file logging
4445
- [X] Avoid duplicating of module_path and filename in every log record
4546
- [ ] Simultaneous modification of all targets' display/hot logging loglevel by key command
4647

48+
## AI generated documentation
49+
50+
I have stumbled over an excellent AI-generated description of `tui-logger`, which provides surprisingly deep and (mostly) correct implementation details.
51+
It would have costed me many days to write an equally good description with so many details and diagrams.
52+
This docu can be found [here](https://deepwiki.com/gin66/tui-logger).
53+
4754
### Smart Widget
4855

4956
Smart widget consists of two widgets. Left is the target selector widget and
@@ -135,6 +142,16 @@ Run demo using termion and simple custom formatter in bottom right log widget:
135142
cargo run --example demo --features termion,formatter
136143
```
137144

145+
### Configuration by environment variables
146+
147+
`tui.logger` uses `env-filter` crate to support configuration by a string or an environment variable.
148+
This is an opt-in by call to one of these two functions.
149+
```rust
150+
pub fn set_env_filter_from_string(filterstring: &str)
151+
pub fn set_env_filter_from_env(env_name: Option<&str>)
152+
```
153+
Default environment variable name is `RUST_LOG`.
154+
138155
### `slog` support
139156

140157
`tui-logger` provides a [`TuiSlogDrain`] which implements `slog::Drain` and will route all records
@@ -144,9 +161,7 @@ Enabled by feature "slog-support"
144161

145162
### `tracing-subscriber` support
146163

147-
`tui-logger` provides a [`TuiTracingSubscriberLayer`] which implements
148-
`tracing_subscriber::Layer` and will collect all events
149-
it receives to the `tui-logger` widget
164+
`tui-logger` provides a [`TuiTracingSubscriberLayer`] which implements `tracing_subscriber::Layer` and will collect all events it receives to the `tui-logger` widget
150165

151166
Enabled by feature "tracing-support"
152167

@@ -260,7 +275,6 @@ TuiLoggerWidget
260275
* [Kevin](https://github.com/doesnotcompete) for providing patch in [#71](https://github.com/issues/71)
261276
* [urizennnn](https://github.com/urizennnn) for providing patch in [#72](https://github.com/issues/72)
262277
* [Earthgames](https://github.com/Earthgames) for providing patch in [#84](https://github.com/issues/84) to fix panic for unicode characters
263-
* [Reinier Balt](https://github.com/Irbalt) for providing patch in [#90](https://github.com/issues/90) to add attributes of the current span for tracing subscriber
264278

265279
### Star History
266280

src/lib.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
//!
1313
//! [Documentation](https://docs.rs/tui-logger/latest/tui_logger/)
1414
//!
15+
//! I have stumbled over an excellent AI-generated description of `tui-logger`, which provides surprisingly deep and (mostly) correct implementation details.
16+
//! It would have costed me many days to write an equally good description with so many details and diagrams.
17+
//! This docu can be found [here](https://deepwiki.com/gin66/tui-logger).
18+
//!
1519
//! ## Important note for `tui`
1620
//!
1721
//! The `tui` crate has been archived and `ratatui` has taken over.
@@ -36,6 +40,7 @@
3640
//! - [X] `slog` support, providing a Drain to integrate into your `slog` infrastructure
3741
//! - [X] `tracing` support
3842
//! - [X] Support to use custom formatter for log events
43+
//! - [X] Configurable by environment variables
3944
//! - [ ] Allow configuration of target dependent loglevel specifically for file logging
4045
//! - [X] Avoid duplicating of module_path and filename in every log record
4146
//! - [ ] Simultaneous modification of all targets' display/hot logging loglevel by key command
@@ -131,6 +136,16 @@
131136
//! cargo run --example demo --features termion,formatter
132137
//! ```
133138
//!
139+
//! ## Configuration by environment variables
140+
//!
141+
//! `tui.logger` uses `env-filter` crate to support configuration by a string or an environment variable.
142+
//! This is an opt-in by call to one of these two functions.
143+
//! ```rust
144+
//! pub fn set_env_filter_from_string(filterstring: &str)
145+
//! pub fn set_env_filter_from_env(env_name: Option<&str>)
146+
//! ```
147+
//! Default environment variable name is `RUST_LOG`.
148+
//!
134149
//! ## `slog` support
135150
//!
136151
//! `tui-logger` provides a [`TuiSlogDrain`] which implements `slog::Drain` and will route all records

0 commit comments

Comments
 (0)