From f5f07178234848100daab0776a7cc3ff13c076ec Mon Sep 17 00:00:00 2001 From: James Liu Date: Sat, 1 Jan 2022 20:22:23 -0500 Subject: [PATCH 1/4] Add crate level docs to bevy_log and enable warn(missing_docs) --- crates/bevy_log/src/lib.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/crates/bevy_log/src/lib.rs b/crates/bevy_log/src/lib.rs index 184b1214849dd..03d5f6c5f20e6 100644 --- a/crates/bevy_log/src/lib.rs +++ b/crates/bevy_log/src/lib.rs @@ -1,7 +1,21 @@ +#![warn(missing_docs)] +//! This crate provides logging functions and configuration for [Bevy](https://bevyengine.org) +//! apps, and automatically configures platform specific log handlers (i.e. WASM or Android). +//! +//! The macros provided for logging are reexported from [`tracing`](https://docs.rs/tracing), +//! and behave identically to it. +//! +//! By default, the [`LogPlugin`] from this crate are included in Bevy's `DefaultPlugins` +//! and the logging macros can be used out of the box, if used. +//! +//! For more fine-tuned control over logging behavior, insert a [`LogSettings`] resource before +//! adding [`LogPlugin`] or `DefaultPlugins` during app initialization. + #[cfg(target_os = "android")] mod android_tracing; pub mod prelude { + //! The Bevy Log Prelude. #[doc(hidden)] pub use bevy_utils::tracing::{ debug, debug_span, error, error_span, info, info_span, trace, trace_span, warn, warn_span, @@ -61,6 +75,12 @@ use tracing_subscriber::{prelude::*, registry::Registry, EnvFilter}; /// .run(); /// } /// ``` +/// +/// # Panics +/// +/// 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 initializaiton multiple times will lead toa panic. #[derive(Default)] pub struct LogPlugin; From 3db926acf339d4d9a8803c268fd4194030292d04 Mon Sep 17 00:00:00 2001 From: James Liu Date: Sat, 1 Jan 2022 22:57:01 -0500 Subject: [PATCH 2/4] Fix formatting --- crates/bevy_log/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/bevy_log/src/lib.rs b/crates/bevy_log/src/lib.rs index 03d5f6c5f20e6..9155f7b0e0011 100644 --- a/crates/bevy_log/src/lib.rs +++ b/crates/bevy_log/src/lib.rs @@ -1,13 +1,13 @@ #![warn(missing_docs)] //! This crate provides logging functions and configuration for [Bevy](https://bevyengine.org) //! apps, and automatically configures platform specific log handlers (i.e. WASM or Android). -//! +//! //! The macros provided for logging are reexported from [`tracing`](https://docs.rs/tracing), //! and behave identically to it. -//! +//! //! By default, the [`LogPlugin`] from this crate are included in Bevy's `DefaultPlugins` //! and the logging macros can be used out of the box, if used. -//! +//! //! For more fine-tuned control over logging behavior, insert a [`LogSettings`] resource before //! adding [`LogPlugin`] or `DefaultPlugins` during app initialization. From 856f430a670be3178337878afd4df53e1ac65897 Mon Sep 17 00:00:00 2001 From: James Liu Date: Sun, 2 Jan 2022 13:38:37 -0500 Subject: [PATCH 3/4] Fix typos --- crates/bevy_log/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_log/src/lib.rs b/crates/bevy_log/src/lib.rs index 9155f7b0e0011..6a688bde4eb2b 100644 --- a/crates/bevy_log/src/lib.rs +++ b/crates/bevy_log/src/lib.rs @@ -80,7 +80,7 @@ use tracing_subscriber::{prelude::*, registry::Registry, EnvFilter}; /// /// 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 initializaiton multiple times will lead toa panic. +/// rerunning the same initialization multiple times will lead to a panic. #[derive(Default)] pub struct LogPlugin; From 53be7cfcd2619098380a513bc33472a435800696 Mon Sep 17 00:00:00 2001 From: James Liu Date: Wed, 19 Jan 2022 01:32:24 -0800 Subject: [PATCH 4/4] fix grammar Co-authored-by: Niklas Eicker --- crates/bevy_log/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_log/src/lib.rs b/crates/bevy_log/src/lib.rs index 6a688bde4eb2b..c9e04cafde31f 100644 --- a/crates/bevy_log/src/lib.rs +++ b/crates/bevy_log/src/lib.rs @@ -5,7 +5,7 @@ //! The macros provided for logging are reexported from [`tracing`](https://docs.rs/tracing), //! and behave identically to it. //! -//! By default, the [`LogPlugin`] from this crate are included in Bevy's `DefaultPlugins` +//! By default, the [`LogPlugin`] from this crate is included in Bevy's `DefaultPlugins` //! and the logging macros can be used out of the box, if used. //! //! For more fine-tuned control over logging behavior, insert a [`LogSettings`] resource before