logging improvements
This commit is contained in:
parent
27c8697899
commit
3f19aaa7c3
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -2256,7 +2256,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tesla-charge-controller"
|
||||
version = "0.2.4"
|
||||
version = "0.2.5"
|
||||
dependencies = [
|
||||
"async-channel",
|
||||
"chrono",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "tesla-charge-controller"
|
||||
version = "0.2.4"
|
||||
version = "0.2.5"
|
||||
edition = "2021"
|
||||
license = "MITNFA"
|
||||
description = "Controls Tesla charge rate based on solar charge data"
|
||||
|
|
1
debian/service
vendored
1
debian/service
vendored
|
@ -9,6 +9,7 @@ Restart=always
|
|||
RestartSec=10s
|
||||
User=tesla
|
||||
Environment="RUST_LOG=error,warn"
|
||||
Environment="LOG_TIMESTAMP=false"
|
||||
ExecStart=/usr/bin/tesla-charge-controller watch
|
||||
|
||||
[Install]
|
||||
|
|
11
src/main.rs
11
src/main.rs
|
@ -39,7 +39,16 @@ enum Commands {
|
|||
#[tokio::main]
|
||||
async fn main() {
|
||||
let args = Args::parse();
|
||||
env_logger::init();
|
||||
env_logger::builder()
|
||||
.format_module_path(false)
|
||||
.format_timestamp(
|
||||
if std::env::var("LOG_TIMESTAMP").is_ok_and(|v| v == "false") {
|
||||
None
|
||||
} else {
|
||||
Some(env_logger::TimestampPrecision::Seconds)
|
||||
},
|
||||
)
|
||||
.init();
|
||||
|
||||
let auth_path = args.config_dir.join("auth");
|
||||
|
||||
|
|
Loading…
Reference in a new issue