Skip to content

Commit

Permalink
build: always include env_logger, resolve #65
Browse files Browse the repository at this point in the history
  • Loading branch information
KonradHoeffner committed Apr 9, 2024
1 parent 98f9f50 commit bca3b2c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ tinytemplate = "1"
serde = { version = "1", features = ["derive"] }
config = { version = "0.14", default-features = false, features = ["toml"] }
log = "0.4"
env_logger = { version = "0.11", default-features = false, features = ["auto-color"], optional = true }
env_logger = { version = "0.11", default-features = false, features = ["auto-color"] }
hdt = { version = "0.1", optional = true }
deepsize = { version = "0.2", default-features = false, features = ["std"] }
bytesize = "1"
Expand All @@ -29,9 +29,8 @@ lazy_static = "1"
serde_json = "1"

[features]
default = ["rdfxml", "log", "hdt"]
default = ["rdfxml", "hdt"]
rdfxml = ["sophia/xml"]
log = ["env_logger"]
hdt = ["dep:hdt"]

[profile.release]
Expand Down
9 changes: 3 additions & 6 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,10 @@ impl Config {
if config.base.ends_with('/') {
config.base.pop();
}
#[cfg(feature = "log")]
{
if std::env::var("RUST_LOG").is_err() {
std::env::set_var("RUST_LOG", format!("rickview={}", config.log_level.as_ref().unwrap_or(&"info".to_owned())));
}
env_logger::builder().format_timestamp(None).format_target(false).init();
if std::env::var("RUST_LOG").is_err() {
std::env::set_var("RUST_LOG", format!("rickview={}", config.log_level.as_ref().unwrap_or(&"info".to_owned())));
}
env_logger::builder().format_timestamp(None).format_target(false).init();

// path relative to executable
match std::fs::File::open("data/body.html") {
Expand Down

0 comments on commit bca3b2c

Please sign in to comment.