Standardize on capitalization of log levels #183

Closed
opened 2017-05-29 22:07:23 -05:00 by dtolnay · 7 comments
dtolnay commented 2017-05-29 22:07:23 -05:00 (Migrated from github.com)

The Display impl generates all caps.

assert_eq!("INFO", LogLevel::Info.to_string());

But all the env_logger example code uses lowercase.

$ RUST_LOG=info ./main

The FromStr impl is case insensitive so this is fine, but it makes it hard to pin down which one makes more sense for the Serialize impl to generate (#143).

The Display impl generates all caps. ```rust assert_eq!("INFO", LogLevel::Info.to_string()); ``` But all the env_logger example code uses lowercase. ``` $ RUST_LOG=info ./main ``` The FromStr impl is case insensitive so this is fine, but it makes it hard to pin down which one makes more sense for the Serialize impl to generate (#143).
daboross commented 2017-06-03 04:21:09 -05:00 (Migrated from github.com)

I'd think it fairly reasonable to have all configuration and documentation name levels with all lowercase, and have any end-user-displaying be all uppercase. I think a distinction between configuration&documentation vs. logging display clarifies this some - but then should the Display implementation assume that it's being passed to an end user/logger?

I'd think it fairly reasonable to have all configuration and documentation name levels with all lowercase, and have any end-user-displaying be all uppercase. I think a distinction between configuration&documentation vs. logging display clarifies this some - but then should the Display implementation assume that it's being passed to an end user/logger?
brson commented 2017-07-05 21:27:25 -05:00 (Migrated from github.com)

No progress here. Do we want to make any changes?

No progress here. Do we want to make any changes?
brson commented 2017-07-14 19:58:01 -05:00 (Migrated from github.com)

cc @alexcrichton @sfackler

cc @alexcrichton @sfackler
daboross commented 2017-07-14 20:00:04 -05:00 (Migrated from github.com)

I would be inclined to believe the current behavior is the best solution. Display::fmt, for directly displaying log levels, is all-caps, and everything configuration related (Serialize, Deserialize, examples, etc.) is lower case.

I would be inclined to believe the current behavior is the best solution. `Display::fmt`, for directly displaying log levels, is all-caps, and everything configuration related (Serialize, Deserialize, examples, etc.) is lower case.
alexcrichton commented 2017-07-16 11:27:11 -05:00 (Migrated from github.com)

I'd also be fine with the current behavior as @daboross mentioned

I'd also be fine with the current behavior as @daboross mentioned
sfackler commented 2017-07-16 17:40:15 -05:00 (Migrated from github.com)

👍

👍
ahmedcharles commented 2017-07-27 00:09:28 -05:00 (Migrated from github.com)

Shouldn't this be closed now?

Shouldn't this be closed now?
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-rust-lang/log#183
No description provided.