Skip to content
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
72 changes: 30 additions & 42 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: CI
on: [push, pull_request]

# Ensure only read permission is granted
permissions:
contents: read # to fetch code (actions/checkout)
contents: read

jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [stable, beta, nightly, macos, win32, win64, mingw]
include:
- build: stable
os: ubuntu-latest
Expand All @@ -34,65 +34,52 @@ jobs:
os: windows-latest
rust: stable-x86_64-pc-windows-gnu
steps:
- uses: actions/checkout@master
- name: Install Rust
- uses: actions/checkout@v4
- name: Install toolchain
run: |
rustup update ${{ matrix.rust }} --no-self-update
rustup default ${{ matrix.rust }}
cargo install cargo-hack
- run: cargo hack test --feature-powerset --lib --exclude-features max_level_off,max_level_error,max_level_warn,max_level_info,max_level_debug,max_level_trace,release_max_level_off,release_max_level_error,release_max_level_warn,release_max_level_info,release_max_level_debug,release_max_level_trace
cargo +stable install cargo-hack --locked
- run: cargo hack test --feature-powerset --exclude-features max_level_off,max_level_error,max_level_warn,max_level_info,max_level_debug,max_level_trace,release_max_level_off,release_max_level_error,release_max_level_warn,release_max_level_info,release_max_level_debug,release_max_level_trace
- run: cargo run --verbose --manifest-path test_max_level_features/Cargo.toml
- run: cargo run --verbose --manifest-path test_max_level_features/Cargo.toml --release

rustfmt:
name: Rustfmt
check:
name: Check Format and Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust
- uses: actions/checkout@v4
- name: Install toolchain
run: |
rustup update stable --no-self-update
rustup default stable
rustup component add rustfmt
# log repo does not use Cargo workspaces, so `cargo fmt` will not check all the code
# perhaps this should be changed in the future
rustup component add clippy rustfmt
- run: cargo fmt -- --check
- run: cargo fmt --manifest-path test_max_level_features/Cargo.toml -- --check
- run: cargo fmt --manifest-path tests/Cargo.toml -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust
run: |
rustup update stable --no-self-update
rustup default stable
rustup component add clippy
- run: cargo clippy --verbose
- run: cargo clippy --verbose --manifest-path test_max_level_features/Cargo.toml
- run: cargo clippy --verbose --manifest-path tests/Cargo.toml

doc:
name: Check Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust
- uses: actions/checkout@v4
- name: Install toolchain
run: |
rustup update stable --no-self-update
rustup default stable
rustup component add rust-docs
- name: Run rustdoc
run: RUSTDOCFLAGS="-D warnings" cargo doc --verbose --features std,serde,sval,sval_ref,value-bag,kv,kv_std,kv_sval,kv_serde
env:
RUSTDOCFLAGS: "-D warnings"
run: cargo doc --verbose --features std,serde,sval,sval_ref,value-bag,kv,kv_std,kv_sval,kv_serde

features:
name: Feature check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust
- uses: actions/checkout@v4
- name: Install toolchain
run: |
rustup update nightly --no-self-update
rustup default nightly
Expand All @@ -107,8 +94,8 @@ jobs:
name: Minimal versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust
- uses: actions/checkout@v4
- name: Install toolchain
run: |
rustup update nightly --no-self-update
rustup default nightly
Expand All @@ -123,21 +110,22 @@ jobs:
name: MSRV
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust
- uses: actions/checkout@v4
- name: Install toolchain
run: |
rustup update 1.60.0 --no-self-update
rustup default 1.60.0
- run: |
cargo test --verbose --manifest-path tests/Cargo.toml
cargo test --verbose --manifest-path tests/Cargo.toml --features kv
rustup update 1.61.0 --no-self-update
rustup default 1.61.0
cargo +stable install cargo-hack --locked
- run: cargo hack test --feature-powerset --exclude-features max_level_off,max_level_error,max_level_warn,max_level_info,max_level_debug,max_level_trace,release_max_level_off,release_max_level_error,release_max_level_warn,release_max_level_info,release_max_level_debug,release_max_level_trace
- run: cargo run --verbose --manifest-path test_max_level_features/Cargo.toml
- run: cargo run --verbose --manifest-path test_max_level_features/Cargo.toml --release

embedded:
name: Embedded
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust
- uses: actions/checkout@v4
- name: Install toolchain
run: |
rustup update stable --no-self-update
rustup default stable
Expand Down
24 changes: 14 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

## [Unreleased]

### Notable Changes
* MSRV is bumped to 1.61.0 in https://github.com/rust-lang/log/pull/676

## [0.4.27] - 2025-03-24

## What's Changed
### What's Changed
* A few minor lint fixes by @nyurik in https://github.com/rust-lang/log/pull/671
* Enable clippy support for format-like macros by @nyurik in https://github.com/rust-lang/log/pull/665
* Add an optional logger param by @tisonkun in https://github.com/rust-lang/log/pull/664
Expand All @@ -13,9 +16,10 @@

**Full Changelog**: https://github.com/rust-lang/log/compare/0.4.26...0.4.27


## [0.4.26] - 2025-02-18

## What's Changed
### What's Changed
* Derive `Clone` for `kv::Value` by @SpriteOvO in https://github.com/rust-lang/log/pull/668
* Add `spdlog-rs` link to crate doc by @SpriteOvO in https://github.com/rust-lang/log/pull/669

Expand All @@ -24,23 +28,23 @@

## [0.4.25] - 2025-01-14

## What's Changed
### What's Changed
* Revert loosening of kv cargo features by @KodrAus in https://github.com/rust-lang/log/pull/662


**Full Changelog**: https://github.com/rust-lang/log/compare/0.4.24...0.4.25

## [0.4.24] - 2025-01-11

## What's Changed
### What's Changed
* Fix up kv feature activation by @KodrAus in https://github.com/rust-lang/log/pull/659


**Full Changelog**: https://github.com/rust-lang/log/compare/0.4.23...0.4.24

## [0.4.23] - 2025-01-10 (yanked)

## What's Changed
### What's Changed
* Fix some typos by @Kleinmarb in https://github.com/rust-lang/log/pull/637
* Add logforth to implementation by @tisonkun in https://github.com/rust-lang/log/pull/638
* Add `spdlog-rs` link to README by @SpriteOvO in https://github.com/rust-lang/log/pull/639
Expand All @@ -51,7 +55,7 @@
* Fix up key lifetimes and add method to try get a borrowed key by @KodrAus in https://github.com/rust-lang/log/pull/653
* Add Ftail implementation by @tjardoo in https://github.com/rust-lang/log/pull/652

## New Contributors
### New Contributors
* @Kleinmarb made their first contribution in https://github.com/rust-lang/log/pull/637
* @tisonkun made their first contribution in https://github.com/rust-lang/log/pull/638
* @SpriteOvO made their first contribution in https://github.com/rust-lang/log/pull/639
Expand All @@ -64,7 +68,7 @@

## [0.4.22] - 2024-06-27

## What's Changed
### What's Changed
* Add some clarifications to the library docs by @KodrAus in https://github.com/rust-lang/log/pull/620
* Add links to `colog` crate by @chrivers in https://github.com/rust-lang/log/pull/621
* adding line_number test + updating some testing infrastructure by @DIvkov575 in https://github.com/rust-lang/log/pull/619
Expand All @@ -75,7 +79,7 @@
* Loosen orderings for logger initialization in https://github.com/rust-lang/log/pull/632. Originally by @pwoolcoc in https://github.com/rust-lang/log/pull/599
* Use Location::caller() for file and line info in https://github.com/rust-lang/log/pull/633. Originally by @Cassy343 in https://github.com/rust-lang/log/pull/520

## New Contributors
### New Contributors
* @chrivers made their first contribution in https://github.com/rust-lang/log/pull/621
* @DIvkov575 made their first contribution in https://github.com/rust-lang/log/pull/619
* @Catamantaloedis made their first contribution in https://github.com/rust-lang/log/pull/625
Expand All @@ -84,7 +88,7 @@

## [0.4.21] - 2024-02-27

## What's Changed
### What's Changed
* Minor clippy nits by @nyurik in https://github.com/rust-lang/log/pull/578
* Simplify Display impl by @nyurik in https://github.com/rust-lang/log/pull/579
* Set all crates to 2021 edition by @nyurik in https://github.com/rust-lang/log/pull/580
Expand All @@ -104,7 +108,7 @@
* Use `Acquire` ordering for initialization check by @AngelicosPhosphoros in https://github.com/rust-lang/log/pull/610
* Get structured logging API ready for stabilization by @KodrAus in https://github.com/rust-lang/log/pull/613

## New Contributors
### New Contributors
* @nyurik made their first contribution in https://github.com/rust-lang/log/pull/578
* @dimo414 made their first contribution in https://github.com/rust-lang/log/pull/590
* @peterjoel made their first contribution in https://github.com/rust-lang/log/pull/587
Expand Down
20 changes: 5 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,12 @@ A lightweight logging facade for Rust
categories = ["development-tools::debugging"]
keywords = ["logging"]
exclude = ["rfcs/**/*"]
rust-version = "1.60.0"
rust-version = "1.61.0"
edition = "2021"

[package.metadata.docs.rs]
features = ["std", "serde", "kv_std", "kv_sval", "kv_serde"]

[[test]]
name = "integration"
path = "tests/integration.rs"
harness = false

[[test]]
name = "macros"
path = "tests/macros.rs"
harness = true

[features]
max_level_off = []
max_level_error = []
Expand Down Expand Up @@ -60,19 +50,19 @@ kv_unstable_serde = ["kv_serde", "kv_unstable_std"]

[dependencies]
serde = { version = "1.0", optional = true, default-features = false }
sval = { version = "2.1", optional = true, default-features = false }
sval = { version = "2.14.1", optional = true, default-features = false }
sval_ref = { version = "2.1", optional = true, default-features = false }
value-bag = { version = "1.7", optional = true, default-features = false, features = ["inline-i128"] }

[dev-dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_test = "1.0"
serde_json = { version = "1.0" }
serde_test = { version = "1.0" }
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 depend 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.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ implementation that is most suitable for its use case.

## Minimum supported `rustc`

`1.60.0+`
`1.61.0+`

This version is explicitly tested in CI and may be bumped in any release as needed. Maintaining compatibility with older compilers is a priority though, so the bar for bumping the minimum supported version is set very high. Any changes to the supported minimum version will be called out in the release notes.

Expand Down
22 changes: 0 additions & 22 deletions tests/Cargo.toml

This file was deleted.

5 changes: 3 additions & 2 deletions tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ impl Log for Logger {
}
fn flush(&self) {}
}
#[cfg_attr(lib_build, test)]
fn main() {

#[test]
fn test_integration() {
// These tests don't really make sense when static
// max level filtering is applied
#[cfg(not(any(
Expand Down
5 changes: 0 additions & 5 deletions tests/src/build.rs

This file was deleted.

14 changes: 0 additions & 14 deletions tests/src/lib.rs

This file was deleted.