Repository: slog-rs/slog (language: rust)

Issue:
Unconsistent slog::Level conversion to string on Warning variation
`slog::Level::Warning.as_str()` results in the same `WARN` as `slog::Level::Warning.as_short_str()` instead of the `WARNING` one might expect. Is this intentional in anyway?

The related source:
https://github.com/slog-rs/slog/blob/f9e30f0dd9bad610227d9374001fcc13d5b7c8c8/src/lib.rs#L2076-L2086

Where variants like `Critical` are `CRITICAL` and `CRIT` on the str representation.


Discussion / hints:
Probably not. Weird that no one ever raised it.

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 356e5dba..fd45d02c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
 * Fix `#` format when not used as a last argument.
 * Implement `Value` for `std::borrow::Cow`
 * Fix duplicate `AsRef<str>` implementations, fixing support for `dynamic-keys`
+* Fix incorrect 'long' name for `slog::Level::Warning` (fixes issue #282)
 
 ## 2.7.0 - 2020-11-29
 
diff --git a/src/lib.rs b/src/lib.rs
index 7dc4eced..86c2c970 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -2090,8 +2090,9 @@ impl<D: Drain> Drain for std::sync::Mutex<D> {
 /// Official capitalized logging (and logging filtering) level names
 ///
 /// In order of `as_usize()`.
-pub static LOG_LEVEL_NAMES: [&str; 7] =
-    ["OFF", "CRITICAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"];
+pub static LOG_LEVEL_NAMES: [&str; 7] = [
+    "OFF", "CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG", "TRACE",
+];
 
 /// Official capitalized logging (and logging filtering) short level names
 ///


Test patch: