diff --git a/Cargo.toml b/Cargo.toml index ff9c9fd3..8f7134ca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,13 +62,13 @@ fnv = "1.0" humantime = { version = "2.1", optional = true } log = { version = "0.4.20", features = ["std"] } log-mdc = { version = "0.1", optional = true } -serde = { version = "1.0", optional = true, features = ["derive"] } +serde = { version = "1.0.196", optional = true, features = ["derive"] } serde-value = { version = "0.7", optional = true } thread-id = { version = "4", optional = true } typemap-ors = { version = "1.0.0", optional = true } serde_json = { version = "1.0", optional = true } serde_yaml = { version = "0.9", optional = true } -toml = { version = "0.8", optional = true } +toml = { version = "<0.8.10", optional = true } parking_lot = { version = "0.12.0", optional = true } rand = { version = "0.8", optional = true} thiserror = "1.0.15" diff --git a/README.md b/README.md index 056d1e4d..c35baf4d 100644 --- a/README.md +++ b/README.md @@ -9,23 +9,6 @@ log4rs is a highly configurable logging framework modeled after Java's Logback and log4j libraries. -## Warning - -If you are using the file rotation in your configuration there is a known -substantial performance issue so listen up! By default the `gzip` feature -is enabled and when rolling files it will zip log archives automatically. -This is a problem when the log archives are large as the zip happens in the -main thread and will halt the process while the zip is completed. Be advised -that the `gzip` feature will be removed from default features as of `1.0`. - -The methods to mitigate this are as follows. - -1. Use the `background_rotation` feature which spawns an os thread to do the compression. -1. Disable the `gzip` feature with `--no-default-features`. -1. Ensure the archives are small enough that the compression time is acceptable. - -For more information see the PR that added [`background_rotation`](https://github.com/estk/log4rs/pull/117). - ## Quick Start log4rs.yaml: @@ -82,6 +65,23 @@ fn main() { * Run the tests for all individual features for windows with [cross](https://github.com/rust-embedded/cross): `./test.sh win` + +## Compression + +If you are using the file rotation in your configuration there is a known +substantial performance issue with the `gzip` feature. When rolling files +it will zip log archives automatically. This is a problem when the log archives +are large as the zip happens in the main thread and will halt the process while +the zip is completed. + +The methods to mitigate this are as follows. + +1. Use the `background_rotation` feature which spawns an os thread to do the compression. +2. Do not enable the `gzip` feature. +3. Ensure the archives are small enough that the compression time is acceptable. + +For more information see the PR that added [`background_rotation`](https://github.com/estk/log4rs/pull/117). + ## License Licensed under either of diff --git a/src/append/rolling_file/policy/compound/mod.rs b/src/append/rolling_file/policy/compound/mod.rs index 484af19c..3e14ae06 100644 --- a/src/append/rolling_file/policy/compound/mod.rs +++ b/src/append/rolling_file/policy/compound/mod.rs @@ -2,7 +2,7 @@ //! //! Requires the `compound_policy` feature. #[cfg(feature = "config_parsing")] -use serde::{self, de}; +use serde::de; #[cfg(feature = "config_parsing")] use serde_value::Value; #[cfg(feature = "config_parsing")] diff --git a/src/config/raw.rs b/src/config/raw.rs index a092d56b..9868b495 100644 --- a/src/config/raw.rs +++ b/src/config/raw.rs @@ -89,9 +89,7 @@ //! ``` #![allow(deprecated)] -use std::{ - borrow::ToOwned, collections::HashMap, fmt, marker::PhantomData, sync::Arc, time::Duration, -}; +use std::{collections::HashMap, fmt, marker::PhantomData, sync::Arc, time::Duration}; use anyhow::anyhow; use derivative::Derivative; @@ -288,9 +286,9 @@ impl Deserializers { } /// Deserializes a value of a specific type and kind. - pub fn deserialize(&self, kind: &str, config: Value) -> anyhow::Result> + pub fn deserialize(&self, kind: &str, config: Value) -> anyhow::Result> where - T: Deserializable, + T: Deserializable + ?Sized, { match self.0.get::>().and_then(|m| m.get(kind)) { Some(b) => b.deserialize(config, self), diff --git a/src/config/runtime.rs b/src/config/runtime.rs index 6b80019f..3d04947e 100644 --- a/src/config/runtime.rs +++ b/src/config/runtime.rs @@ -1,7 +1,7 @@ //! log4rs configuration use log::LevelFilter; -use std::{collections::HashSet, iter::IntoIterator}; +use std::collections::HashSet; use thiserror::Error; use crate::{append::Append, filter::Filter};