Skip to content

Commit d865583

Browse files
chore: fix doctests and changelog
1 parent e34636a commit d865583

4 files changed

Lines changed: 30 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,8 @@ All the dates in this changelog are formatted as day/month/year.
7979
# 2.2.5 - 10/7/2025
8080

8181
- I can't fix these damn screenshots
82+
83+
# 2.2.6 - 10/12/2025
84+
85+
- Added the `parse_level_from_env` that checks the `RUST_LOG` environment variable.
86+
- Apply fixes suggested by clippy.

logs/app.log

Whitespace-only changes.

src/macros.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ macro_rules! log {
3131
/// # Examples
3232
///
3333
/// ```
34+
/// use traccia::{init_default, trace};
35+
///
36+
/// init_default();
37+
/// let item_id = 42;
3438
/// trace!("Processing item: {}", item_id);
3539
/// ```
3640
#[macro_export]
@@ -45,6 +49,10 @@ macro_rules! trace {
4549
/// # Examples
4650
///
4751
/// ```
52+
/// use traccia::{init_default, debug};
53+
///
54+
/// init_default();
55+
/// let conn_id = 123;
4856
/// debug!("Connection established: {}", conn_id);
4957
/// ```
5058
#[macro_export]
@@ -59,6 +67,9 @@ macro_rules! debug {
5967
/// # Examples
6068
///
6169
/// ```
70+
/// use traccia::{init_default, info};
71+
///
72+
/// init_default();
6273
/// info!("Application started");
6374
/// ```
6475
#[macro_export]
@@ -73,6 +84,10 @@ macro_rules! info {
7384
/// # Examples
7485
///
7586
/// ```
87+
/// use traccia::{init_default, warn};
88+
///
89+
/// init_default();
90+
/// let usage = 85;
7691
/// warn!("Resource usage high: {}%", usage);
7792
/// ```
7893
#[macro_export]
@@ -87,6 +102,10 @@ macro_rules! warn {
87102
/// # Examples
88103
///
89104
/// ```
105+
/// use traccia::{init_default, error};
106+
///
107+
/// init_default();
108+
/// let err = "timeout";
90109
/// error!("Failed to connect: {}", err);
91110
/// ```
92111
#[macro_export]
@@ -101,6 +120,10 @@ macro_rules! error {
101120
/// # Examples
102121
///
103122
/// ```
123+
/// use traccia::{init_default, fatal};
124+
///
125+
/// init_default();
126+
/// let err = "configuration error";
104127
/// fatal!("Failed to start application: {}", err);
105128
/// ```
106129
#[macro_export]

src/target.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,9 @@ impl File {
234234
/// # Examples
235235
///
236236
/// ```
237-
/// use logger::{Config, File, init_with_config};
237+
/// use traccia::{Config, File, init_with_config, FileMode};
238238
///
239-
/// let file_target = File::new("logs/app.log").expect("Failed to open log file");
239+
/// let file_target = File::new("logs/app.log", FileMode::Append).expect("Failed to open log file");
240240
/// let config = Config {
241241
/// targets: vec![Box::new(file_target)],
242242
/// ..Config::default()

0 commit comments

Comments
 (0)