Skip to content

Commit

Permalink
rm editions, add changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik committed Oct 21, 2023
1 parent 3237ff7 commit 6403cea
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Change Log

## [Unreleased]
* Migrate to 2021 edition and minor cleanups by @nyurik in https://github.com/rust-lang/log/pull/580
* Use inline format args by @nyurik in https://github.com/rust-lang/log/pull/577

## [0.4.20] - 2023-07-11

Expand Down
22 changes: 11 additions & 11 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
//!
//! ### Examples
//!
//! ```edition2021
//! ```
//! # #[derive(Debug)] pub struct Yak(String);
//! # impl Yak { fn shave(&mut self, _: u32) {} }
//! # fn find_a_razor() -> Result<u32, u32> { Ok(1) }
Expand Down Expand Up @@ -92,7 +92,7 @@
//! with your log records. If we take the example from before, we can include
//! some additional context besides what's in the formatted message:
//!
//! ```edition2021
//! ```
//! # use serde::Serialize;
//! # #[derive(Debug, Serialize)] pub struct Yak(String);
//! # impl Yak { fn shave(&mut self, _: u32) {} }
Expand Down Expand Up @@ -160,7 +160,7 @@
//! logs all messages at the [`Error`][level_link], [`Warn`][level_link] or
//! [`Info`][level_link] levels to stdout:
//!
//! ```edition2021
//! ```
//! use log::{Record, Level, Metadata};
//!
//! struct SimpleLogger;
Expand Down Expand Up @@ -193,7 +193,7 @@
//! provide a function that wraps a call to [`set_logger`] and
//! [`set_max_level`], handling initialization of the logger:
//!
//! ```edition2021
//! ```
//! # use log::{Level, Metadata};
//! # struct SimpleLogger;
//! # impl log::Log for SimpleLogger {
Expand Down Expand Up @@ -223,7 +223,7 @@
//! identical to `set_logger` except that it takes a `Box<Log>` rather than a
//! `&'static Log`:
//!
//! ```edition2021
//! ```
//! # use log::{Level, LevelFilter, Log, SetLoggerError, Metadata};
//! # struct SimpleLogger;
//! # impl log::Log for SimpleLogger {
Expand Down Expand Up @@ -688,7 +688,7 @@ impl<'a> MaybeStaticStr<'a> {
/// The following example shows a simple logger that displays the level,
/// module path, and message of any `Record` that is passed to it.
///
/// ```edition2021
/// ```
/// struct SimpleLogger;
///
/// impl log::Log for SimpleLogger {
Expand Down Expand Up @@ -845,7 +845,7 @@ impl<'a> Record<'a> {
///
/// # Examples
///
/// ```edition2021
/// ```
/// use log::{Level, Record};
///
/// let record = Record::builder()
Expand All @@ -860,7 +860,7 @@ impl<'a> Record<'a> {
///
/// Alternatively, use [`MetadataBuilder`](struct.MetadataBuilder.html):
///
/// ```edition2021
/// ```
/// use log::{Record, Level, MetadataBuilder};
///
/// let error_metadata = MetadataBuilder::new()
Expand Down Expand Up @@ -1011,7 +1011,7 @@ impl<'a> Default for RecordBuilder<'a> {
///
/// # Examples
///
/// ```edition2021
/// ```
/// use log::{Record, Level, Metadata};
///
/// struct MyLogger;
Expand Down Expand Up @@ -1065,7 +1065,7 @@ impl<'a> Metadata<'a> {
///
/// # Example
///
/// ```edition2021
/// ```
/// let target = "myApp";
/// use log::{Level, MetadataBuilder};
/// let metadata = MetadataBuilder::new()
Expand Down Expand Up @@ -1315,7 +1315,7 @@ pub fn set_boxed_logger(logger: Box<dyn Log>) -> Result<(), SetLoggerError> {
///
/// # Examples
///
/// ```edition2021
/// ```
/// use log::{error, info, warn, Record, Level, Metadata, LevelFilter};
///
/// static MY_LOGGER: MyLogger = MyLogger;
Expand Down
14 changes: 7 additions & 7 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
///
/// # Examples
///
/// ```edition2021
/// ```
/// use log::{log, Level};
///
/// # fn main() {
Expand Down Expand Up @@ -65,7 +65,7 @@ macro_rules! log {
///
/// # Examples
///
/// ```edition2021
/// ```
/// use log::error;
///
/// # fn main() {
Expand All @@ -89,7 +89,7 @@ macro_rules! error {
///
/// # Examples
///
/// ```edition2021
/// ```
/// use log::warn;
///
/// # fn main() {
Expand All @@ -113,7 +113,7 @@ macro_rules! warn {
///
/// # Examples
///
/// ```edition2021
/// ```
/// use log::info;
///
/// # fn main() {
Expand All @@ -139,7 +139,7 @@ macro_rules! info {
///
/// # Examples
///
/// ```edition2021
/// ```
/// use log::debug;
///
/// # fn main() {
Expand All @@ -164,7 +164,7 @@ macro_rules! debug {
///
/// # Examples
///
/// ```edition2021
/// ```
/// use log::trace;
///
/// # fn main() {
Expand Down Expand Up @@ -195,7 +195,7 @@ macro_rules! trace {
///
/// # Examples
///
/// ```edition2021
/// ```
/// use log::Level::Debug;
/// use log::{debug, log_enabled};
///
Expand Down

0 comments on commit 6403cea

Please sign in to comment.