mirror of
https://github.com/BurntSushi/jiff.git
synced 2025-12-23 08:47:45 +00:00
Previously, when `TZ` was set to an invalid value, Jiff would still attempt to detect the system configured time zone. But this is arguably not great, because it silently (aside from logs) rejects an invalid `TZ` value. In reality, if `TZ` is set, it is likely that the user intends for it to have an impact. So if it doesn't, we should bleat about it. This manifests as an error when using `TimeZone::try_system()` and manifests as a error sentinel in the form of `Etc/Unknown` when using `TimeZone::system()`. We also tweak some of the logging levels. Namely, in #370, I increased the number of TRACE-level log messages, which makes it much noisier. So I've promoted a few things that were TRACE to DEBUG without making the output much noisier. I guess TRACE should be reserved for variable length things. Fixes #364
18 lines
496 B
TOML
18 lines
496 B
TOML
[package]
|
|
publish = false
|
|
name = "invalid-tz-environment-variable"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
|
|
# Test programs in Jiff are explicitly isolated from the workspace to avoid
|
|
# dev-dependencies accumulating. (Not all test programs have big dependency
|
|
# trees, but we still exclude them from the workspace as a general rule.)
|
|
[workspace]
|
|
|
|
[dependencies]
|
|
env_logger = "0.11.0"
|
|
jiff = { path = "../..", features = ["logging"] }
|
|
|
|
[[bin]]
|
|
name = "invalid-tz-environment-variable"
|
|
path = "main.rs"
|