logging changes

This commit is contained in:
Alex Janka 2024-03-21 12:21:45 +11:00
parent 7d511f3c12
commit 7fdbb13ca4
5 changed files with 5 additions and 5 deletions

2
Cargo.lock generated
View file

@ -1143,7 +1143,7 @@ dependencies = [
[[package]] [[package]]
name = "homekit-exporter" name = "homekit-exporter"
version = "0.5.0" version = "0.5.1"
dependencies = [ dependencies = [
"clap", "clap",
"env_logger", "env_logger",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "homekit-exporter" name = "homekit-exporter"
version = "0.5.0" version = "0.5.1"
edition = "2021" edition = "2021"
license = "Apache-2.0" license = "Apache-2.0"
description = "Prometheus exporter for HomeKit sensors" description = "Prometheus exporter for HomeKit sensors"

View file

@ -1,7 +1,7 @@
# Maintainer: Alex Janka <alex@alexjanka.com> # Maintainer: Alex Janka <alex@alexjanka.com>
pkgname=homekit-logger pkgname=homekit-logger
pkgver=0.5.0 pkgver=0.5.1
pkgrel=1 pkgrel=1
pkgdesc="Prometheus exporter for HomeKit sensors" pkgdesc="Prometheus exporter for HomeKit sensors"
arch=('x86_64' 'aarch64') arch=('x86_64' 'aarch64')

View file

@ -84,7 +84,7 @@ async fn init(pairing_data: PathBuf) -> Result<HashMap<String, DeviceConnection>
set.spawn(async move { set.spawn(async move {
let mut connection = v.to_connection(discovered.clone()); let mut connection = v.to_connection(discovered.clone());
match tokio::time::timeout(Duration::from_secs(2), connection.connect()).await { match tokio::time::timeout(Duration::from_secs(5), connection.connect()).await {
Ok(Err(e)) => log::error!("error connecting to {k}: {e:?}"), Ok(Err(e)) => log::error!("error connecting to {k}: {e:?}"),
Err(_) => log::error!("timeout connecting to {k}"), Err(_) => log::error!("timeout connecting to {k}"),
_ => {} _ => {}

View file

@ -29,7 +29,7 @@ pub async fn metrics(state: &State<Mutex<HashMap<String, DeviceConnection>>>) ->
match tokio::time::timeout(Duration::from_secs(METRIC_GATHER_TIMEOUT_SECS), connected.update_characteristics()).await{ match tokio::time::timeout(Duration::from_secs(METRIC_GATHER_TIMEOUT_SECS), connected.update_characteristics()).await{
Ok(r) => r.ok()?, Ok(r) => r.ok()?,
Err(_) => log::info!("failed to update characteristics for {name}"), Err(_) => log::warn!("failed to update characteristics for {name}"),
} }