[go: up one dir, main page]

slog 2.8.0-rc.1

Structured, extensible, composable logging for Rust
Documentation
[package]
name = "slog"
version = "2.8.0-rc.1"
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.56"

[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"]
# 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.
#
# NOTE: Using nested-values requires Rust 1.56
nested-values = ["erased-serde", "serde"]
# 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 = []
# 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 = []

#
# IMPLICIT FEATURES
#
# These features are fully supported, but have the same names as dependencies.
# The current MSRV does not support the new 'dep:...' syntax.
# We pretend to declare these here to keep the feature docs consistent.
#

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

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]
# TODO: The std feature should imply serde?/std, but weak feature dependencies need Rust 1.60
serde = { version = "1", optional = true, default-features = false }
anyhow = { version = "1", optional = true, default-features = false }

[dependencies.erased-serde]
# The 0.3 series of erased-serde has MSRV 1.56, but the 0.4 series requires Rust 1.61
# Since we want to support old rust, we stick with the old 0.3 series
version = "0.3"
optional = true
default-features = false
features = ["alloc"]  # erased-serde always requires alloc, and so does slog

[build-dependencies]
rustversion = "1"

[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"
serde_derive = "1"

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

[package.metadata.docs.rs]
features = ["std", "nested-values", "dynamic-keys"]

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