Add missing doc comments for log_diagnostics_plugin (#19261)

# Objective

Fill some of the missing docs from bevy_diagnostics.
This commit is contained in:
theotherphil 2025-05-26 23:29:59 +01:00 committed by GitHub
parent 0a11091ea8
commit 1e1853b876
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,8 +15,14 @@ use log::{debug, info};
///
/// When no diagnostics are provided, this plugin does nothing.
pub struct LogDiagnosticsPlugin {
/// If `true` then the `Debug` representation of each `Diagnostic` is logged.
/// If `false` then a (smoothed) current value and historical average are logged.
///
/// Defaults to `false`.
pub debug: bool,
/// Time to wait between logging diagnostics and logging them again.
pub wait_duration: Duration,
/// If `Some` then only these diagnostics are logged.
pub filter: Option<HashSet<DiagnosticPath>>,
}
@ -107,6 +113,7 @@ impl Plugin for LogDiagnosticsPlugin {
}
impl LogDiagnosticsPlugin {
/// Filter logging to only the paths in `filter`.
pub fn filtered(filter: HashSet<DiagnosticPath>) -> Self {
LogDiagnosticsPlugin {
filter: Some(filter),