Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some typos #637

Merged
merged 3 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
target/
Cargo.lock
.idea/
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

## [0.4.18] - 2023-05-28

* fix markdown links (again) by @hellow554 in https://github.com/rust-lang/log/pull/513
* fix Markdown links (again) by @hellow554 in https://github.com/rust-lang/log/pull/513
* add cargo doc to workflow by @hellow554 in https://github.com/rust-lang/log/pull/515
* Apply Clippy lints by @hellow554 in https://github.com/rust-lang/log/pull/516
* Replace ad-hoc eq_ignore_ascii_case with slice::eq_ignore_ascii_case by @glandium in https://github.com/rust-lang/log/pull/519
Expand Down Expand Up @@ -99,7 +99,7 @@
* Improvements to test coverage.
* Improvements to documentation.
* Add key-value support to the `log!` macros.
* Tighten `kv_unstable` internal dependencies so they don't bump past their current alpha.
* Tighten `kv_unstable` internal dependencies, so they don't bump past their current alpha.
* Add a simple visit API to `kv_unstable`.
* Support `NonZero*` integers as values in structured logging
* Support static strings as keys in structured logging
Expand Down Expand Up @@ -149,7 +149,7 @@ as either a map of `{key: value, ..}` or as a list of `[(key, value), ..]`.

### Fixed

* Fixed the `log!` macros so they work in expression context (this regressed in `0.4.9`, which has been yanked).
* Fixed the `log!` macros, so they work in expression context (this regressed in `0.4.9`, which has been yanked).

## [0.4.9] - 2019-12-12 (yanked)

Expand Down Expand Up @@ -260,7 +260,7 @@ version using log 0.4.x to avoid losing module and file information.
* The `logger` free function returns a reference to the logger implementation. This, along with the
ability to construct `Record`s, makes it possible to bridge from another logging framework to
this one without digging into the private internals of the crate. The standard `error!` `warn!`,
etc, macros now exclusively use the public API of the crate rather than "secret" internal APIs.
etc., macros now exclusively use the public API of the crate rather than "secret" internal APIs.
* `Log::flush` has been added to allow crates to tell the logging implementation to ensure that all
"in flight" log events have been persisted. This can be used, for example, just before an
application exits to ensure that asynchronous log sinks finish their work.
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ sval = { version = "2.1" }
sval_derive = { version = "2.1" }
value-bag = { version = "1.7", features = ["test"] }

# NOTE: log doesn't actually depent on this crate. However our dependencies,
# NOTE: log doesn't actually depent on this crate. However, our dependencies,
# serde and sval, dependent on version 1.0 of the crate, which has problem fixed
# in 1.0.60, specifically in the following commit
# https://github.com/dtolnay/proc-macro2/commit/e31d61910049e097afdd3d27c37786309082bdcb.
# By defining the crate as direct dependency we can increase it's minimal
# By defining the crate as direct dependency we can increase its minimal
# version making the minimal (crate) version CI happy.
proc-macro2 = { version = "1.0.63", default-features = false }
2 changes: 1 addition & 1 deletion rfcs/0296-structured-logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -1633,7 +1633,7 @@ Structured logging is a paradigm that's supported by logging frameworks in many

## Rust

The `slog` library is a structured logging framework for Rust. Its API predates a stable `serde` crate so it defines its own traits that are similar to `serde::Serialize`. A log record consists of a rendered message and bag of structured key-value pairs. `slog` goes further than this RFC proposes by requiring callers of its `log!` macros to state whether key-values are owned or borrowed by the record, and whether the data is safe to share across threads.
The `slog` library is a structured logging framework for Rust. Its API predates a stable `serde` crate, so it defines its own traits that are similar to `serde::Serialize`. A log record consists of a rendered message and bag of structured key-value pairs. `slog` goes further than this RFC proposes by requiring callers of its `log!` macros to state whether key-values are owned or borrowed by the record, and whether the data is safe to share across threads.

This RFC proposes an API that's inspired by `slog`, but doesn't directly support distinguishing between owned or borrowed key-value pairs. Everything is borrowed. That means the only way to send a `Record` to another thread is to serialize it into a different type.

Expand Down
2 changes: 1 addition & 1 deletion src/kv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
//! info!(a = 1; "Something of interest");
//! ```
//!
//! Key-values support the same shorthand identifer syntax as `format_args`:
//! Key-values support the same shorthand identifier syntax as `format_args`:
//!
//! ```
//! # use log::info;
Expand Down
10 changes: 5 additions & 5 deletions src/kv/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl<'v> ToValue for Value<'v> {
/// Values provide a number of ways to be serialized.
///
/// For basic types the [`Value::visit`] method can be used to extract the
/// underlying typed value. However this is limited in the amount of types
/// underlying typed value. However, this is limited in the amount of types
/// supported (see the [`VisitValue`] trait methods).
///
/// For more complex types one of the following traits can be used:
Expand Down Expand Up @@ -373,13 +373,13 @@ impl_value_to_primitive![
];

impl<'v> Value<'v> {
/// Try convert this value into an error.
/// Try to convert this value into an error.
#[cfg(feature = "kv_std")]
pub fn to_borrowed_error(&self) -> Option<&(dyn std::error::Error + 'static)> {
self.inner.to_borrowed_error()
}

/// Try convert this value into a borrowed string.
/// Try to convert this value into a borrowed string.
pub fn to_borrowed_str(&self) -> Option<&str> {
self.inner.to_borrowed_str()
}
Expand Down Expand Up @@ -433,7 +433,7 @@ mod std_support {
}

impl<'v> Value<'v> {
/// Try convert this value into a string.
/// Try to convert this value into a string.
pub fn to_cow_str(&self) -> Option<Cow<'v, str>> {
self.inner.to_str()
}
Expand Down Expand Up @@ -725,7 +725,7 @@ pub(in crate::kv) mod inner {

1. Conversions should always produce the same results. If a conversion here returns `Some`, then
the same `value_bag`-based conversion must also. Of particular note here are floats to ints; they're
based on the standard library's `TryInto` conversions, which need to be convert to `i32` or `u32`,
based on the standard library's `TryInto` conversions, which need to be converted to `i32` or `u32`,
and then to `f64`.
2. VisitValues should always be called in the same way. If a particular type of value calls `visit_i64`,
then the same `value_bag`-based visitor must also.
Expand Down
6 changes: 3 additions & 3 deletions src/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::{Level, LevelFilter, LOG_LEVEL_NAMES};
use std::fmt;
use std::str::{self, FromStr};

// The Deserialize impls are handwritten to be case insensitive using FromStr.
// The Deserialize impls are handwritten to be case-insensitive using FromStr.

impl Serialize for Level {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
Expand Down Expand Up @@ -57,7 +57,7 @@ impl<'de> Deserialize<'de> for Level {
where
E: Error,
{
// Case insensitive.
// Case-insensitive.
FromStr::from_str(s).map_err(|_| Error::unknown_variant(s, &LOG_LEVEL_NAMES[1..]))
}

Expand Down Expand Up @@ -152,7 +152,7 @@ impl<'de> Deserialize<'de> for LevelFilter {
where
E: Error,
{
// Case insensitive.
// Case-insensitive.
FromStr::from_str(s).map_err(|_| Error::unknown_variant(s, &LOG_LEVEL_NAMES))
}

Expand Down
2 changes: 1 addition & 1 deletion tests/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! This crate is intentionally left empty.
//!
//! We have an empty library depending on `log` here so we can run integration tests
//! We have an empty library depending on `log` here, so we can run integration tests
//! on older compilers without depending on the unstable `no-dev-deps` flag.

#![allow(dead_code)]
Expand Down