Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timestamp formatting revamp #256

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
283 changes: 279 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ pre-release-replacements = [
]

[features]
default = ["auto-color", "humantime", "regex"]
default = ["auto-color", "chrono", "regex"]
color = ["dep:termcolor"]
auto-color = ["dep:is-terminal", "color"]
humantime = ["dep:humantime"]
chrono = ["dep:chrono"]
regex = ["dep:regex"]

[dependencies]
log = { version = "0.4.8", features = ["std"] }
regex = { version = "1.0.3", optional = true, default-features=false, features=["std", "perf"] }
termcolor = { version = "1.1.1", optional = true }
humantime = { version = "2.0.0", optional = true }
chrono = { version = "0.4.23", optional = true }
is-terminal = { version = "0.4.0", optional = true }

[[test]]
Expand Down
2 changes: 1 addition & 1 deletion ci/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ mod permute;
mod task;

fn main() {
let features = ["color", "humantime", "auto-color", "regex"];
let features = ["color", "chrono", "auto-color", "regex"];

// Run a default build
if !task::test(Default::default()) {
Expand Down
4 changes: 2 additions & 2 deletions examples/custom_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $ export MY_LOG_STYLE=never
If you want to control the logging output completely, see the `custom_logger` example.
*/

#[cfg(all(feature = "color", feature = "humantime"))]
#[cfg(all(feature = "color", feature = "chrono"))]
fn main() {
use env_logger::{fmt::Color, Builder, Env};

Expand Down Expand Up @@ -50,5 +50,5 @@ fn main() {
log::info!("a log from `MyLogger`");
}

#[cfg(not(all(feature = "color", feature = "humantime")))]
#[cfg(not(all(feature = "color", feature = "chrono")))]
fn main() {}