[go: up one dir, main page]

slog 2.8.2

Structured, extensible, composable logging for Rust
Documentation
[package]
name = "slog"
version = "2.8.2"
authors = ["Dawid Ciężarkiewicz <dpc@dpc.pw>"]
description = "Structured, extensible, composable logging for Rust"
keywords = ["log", "logging", "structured", "hierarchical"]
categories = ["development-tools::debugging"]
license = "MPL-2.0 OR MIT OR Apache-2.0"
documentation = "https://docs.rs/slog"
homepage = "https://github.com/slog-rs/slog"
repository = "https://github.com/slog-rs/slog"
readme = "README.md"
edition = "2018"

# This is our Minimum Supported Rust Version (MSRV)
#
# See the wiki for our full policy on changing this.
#
# There are two main requirements:
# 1. Bumping the MSRV requires increasing the minor version number (2.7 -> 2.8)
# 2. Changes must be clearly announced in the CHANGELOG.md file
# 3. At a minimum, we must support at least the latest stable rust, minus 15 releases.
#    - We can (and very often do) support versions much older than this.
#    - See wiki for for details
#
# This must be kept in sync with the following places:
# - .github/workflows/test.yml (Github Actions)
# - README.md
# - clippy.toml (Clippy config)
rust-version = "1.61"

[profile.release]
opt-level = 3
debug = false
lto = true
debug-assertions = false

[profile.bench]
opt-level = 3
debug = false
lto = true
debug-assertions = false

[features]
default = ["std", "nested-values"]
# Support nesting values in log messages using serde
#
# Using this is recommended to improve the detail of log messages.
# Without it, only flat values like numbers and strings can be logged.
# This requires the underlying logger to support this feature,
# usually requiring a nested-values feature flag on the logging backend.
nested-values = ["dep:erased-serde", "dep:serde_core"]
# DANGER: Use a String for slog::Key insated of &'static str
#
# This is discouraged, becauase it can break other libraries relying on slog.
# If you really need to dynamically allocate keys, you can use String::leak to achieve the same functionality
# without breaking other libraries.
dynamic-keys = []
# Require the standard library.
std = ["serde_core?/std", "anyhow?/std"]
# DANGER: Remove the Send + Sync bound from the default logger and drain.
#
# This feature is highly discouraged, because it could break other libraries relying on slog.
# It is possible to achieve the same functionality by using a custom drain parameter to slog::Logger,
# which will not break other libraries and avoids the overhead of an Arc.
nothreads = []

# Implement slog::Value for anyhow::Error
anyhow = ["dep:anyhow"]

# Implement slog::Drain for parking_lot::Mutex.
#
# Each version of parking_lot has a separate feature name,
# so that multiple versions of parking_lot can be supported at once without causing conflicts.
# This works because Cargo supports depending on multiple versions of the same crate,
# and Rust considers parking_lot_0_12::Mutex and parking_lot1::Mutex as completely different types.
#
# Compatibility Guarantees:
# New versions of parking_lot can be added in a patch version of slog (2.8.1 -> 2.8.2)
#
# Support for an old version of parking_lot will be reatined as long as reasonably possible,
# and only removed if it causes significant issues or is known to be severely buggy.
# In the exceptional event that support for an old version is removed,
# it will only happen in a slog minor version upgrade (2.8 -> 2.9), never in a patch version upgrade.
#
# A hypothetical parking_lot v1.0 release would be named `parking_lot1` rather than `parking_lot_1`.
parking_lot_0_12 = ["dep:parking_lot_0_12"]

# Control the log level at compile-time

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 = []

[dependencies]
# Depending on serde_core rather than serde reduces compile times (added in serde v1.0.200)
serde_core = { version = "1", optional = true, default-features = false }
anyhow = { version = "1", optional = true, default-features = false }
parking_lot_0_12 = { package = "parking_lot", version = "0.12", optional = true }

[dependencies.erased-serde]
# For Slog 2.x, we keep compat with `erased-serde 0.3` as it's a public
# dependency, even if newer major versions are available.
# erased-serde 0.3 has MSRV 1.56, which is stronger than our MSRV (1.61)
version = "0.3"
optional = true
default-features = false
features = ["alloc"]  # erased-serde always requires alloc, and so does slog

[build-dependencies]
# rustversion v1.0.6 added the rustversion::cfg! macro
rustversion = "1.0.6"

[dev-dependencies]
# NOTE: This is just a macro (not a runtime dependency)
#
# It is used to conditionally enable use of newer rust language
# features depending on the compiler features.
rustversion = "1.0.6"
# first version to support serde_core
serde = "1.0.220"
serde_derive = "1.0.220"

[[example]]
name = "singlethread"
required-features = ["nothreads"]

[package.metadata.docs.rs]
# Should enable most features
features = [
    "std",
    "nested-values",
    "dynamic-keys",
    "anyhow",
    "parking_lot_0_12"
]

[workspace]
members = [
  "crates/test_edition2018",
]