chore(version): 更新 log4rc 版本至 0.1.2 并修正文档引用
This commit is contained in:
parent
79b05f91a8
commit
e71787c126
|
|
@ -112,7 +112,7 @@ checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "log4rc"
|
name = "log4rc"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "log4rc"
|
name = "log4rc"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
authors = ["log4r contributors"]
|
authors = ["log4r contributors"]
|
||||||
description = "A log4j-like logging framework for Rust"
|
description = "A log4j-like logging framework for Rust"
|
||||||
|
|
|
||||||
16
src/lib.rs
16
src/lib.rs
|
|
@ -1,19 +1,19 @@
|
||||||
//! # log4r - A log4j-like logging framework for Rust
|
//! # log4rc - A log4j-like logging framework for Rust
|
||||||
//!
|
//!
|
||||||
//! This crate provides a simple, extensible logging framework similar to log4j.
|
//! This crate provides a simple, extensible logging framework similar to log4j.
|
||||||
//!
|
//!
|
||||||
//! ## Example
|
//! ## Example
|
||||||
//!
|
//!
|
||||||
//! ```
|
//! ```
|
||||||
//! use log4r::{LogLevel, Logger};
|
//! use log4rc::{LogLevel, Logger};
|
||||||
//!
|
//!
|
||||||
//! Logger::init(LogLevel::Debug);
|
//! Logger::init(LogLevel::Debug);
|
||||||
//!
|
//!
|
||||||
//! log4r::trace!("This is a trace message");
|
//! log4rc::trace!("This is a trace message");
|
||||||
//! log4r::debug!("This is a debug message");
|
//! log4rc::debug!("This is a debug message");
|
||||||
//! log4r::info!("This is an info message");
|
//! log4rc::info!("This is an info message");
|
||||||
//! log4r::warn!("This is a warning message");
|
//! log4rc::warn!("This is a warning message");
|
||||||
//! log4r::error!("This is an error message");
|
//! log4rc::error!("This is an error message");
|
||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
use std::{sync::{Mutex, OnceLock}, time};
|
use std::{sync::{Mutex, OnceLock}, time};
|
||||||
|
|
@ -62,7 +62,7 @@ pub trait Layout: Send + Sync {
|
||||||
fn format(&self, event: &LogEvent) -> String;
|
fn format(&self, event: &LogEvent) -> String;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Simple layout that formats log events as "[LEVEL] message"
|
/// Simple layout that formats log events as "\[level\] message"
|
||||||
pub struct SimpleLayout;
|
pub struct SimpleLayout;
|
||||||
|
|
||||||
impl Layout for SimpleLayout {
|
impl Layout for SimpleLayout {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue