mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
Updated LogPlugin
Documentation with Performance Warning (#14984)
# Objective - Fixes #14966 ## Solution - Added a _Performance_ section to the documentation for `LogPlugin::filter` explaining that long filter strings can degrade performance and to instead rely on `LogPlugin::level` when possible. ## Testing - CI passed locally.
This commit is contained in:
parent
323aa70e3c
commit
250cc63ddf
1 changed files with 14 additions and 0 deletions
|
@ -133,6 +133,20 @@ pub(crate) struct FlushGuard(SyncCell<tracing_chrome::FlushGuard>);
|
|||
/// This plugin should not be added multiple times in the same process. This plugin
|
||||
/// sets up global logging configuration for **all** Apps in a given process, and
|
||||
/// rerunning the same initialization multiple times will lead to a panic.
|
||||
///
|
||||
/// # Performance
|
||||
///
|
||||
/// Filters applied through this plugin are computed at _runtime_, which will
|
||||
/// have a non-zero impact on performance.
|
||||
/// To achieve maximum performance, consider using
|
||||
/// [_compile time_ filters](https://docs.rs/log/#compile-time-filters)
|
||||
/// provided by the [`log`](https://crates.io/crates/log) crate.
|
||||
///
|
||||
/// ```toml
|
||||
/// # cargo.toml
|
||||
/// [dependencies]
|
||||
/// log = { version = "0.4", features = ["max_level_debug", "release_max_level_warn"] }
|
||||
/// ```
|
||||
pub struct LogPlugin {
|
||||
/// Filters logs using the [`EnvFilter`] format
|
||||
pub filter: String,
|
||||
|
|
Loading…
Reference in a new issue