From 283ca5488dc080f04fc5eee227e2a7a21f110331 Mon Sep 17 00:00:00 2001 From: bezineb5 Date: Sat, 1 Oct 2022 23:52:11 +0200 Subject: [PATCH] Added logging --- tlv493d/tlv493d.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tlv493d/tlv493d.go b/tlv493d/tlv493d.go index d83dc8e..34aad9c 100644 --- a/tlv493d/tlv493d.go +++ b/tlv493d/tlv493d.go @@ -7,6 +7,7 @@ package tlv493d import ( "errors" "fmt" + "log" "sync" "time" @@ -404,12 +405,11 @@ func (d *Dev) ReadContinuous(frequency physic.Frequency, precision Precision) (< value, err := d.Read(precision) if err != nil { // Try resetting the sensor to recover from errors - fmt.Println("Error reading from TLV493D sensor:", err) if err := d.initialize(true); err == nil { if err := d.SetMode(newMode); err != nil { - fmt.Println("Unable to reset TLV493D mode:", err) + log.Println("Unable to reset TLV493D mode:", err) } else { - fmt.Println("Sensor reset successfully") + log.Println("Sensor reset successfully") } } continue