Skip to content

Commit

Permalink
fix: logs and typo
Browse files Browse the repository at this point in the history
  • Loading branch information
doniacld committed Jul 27, 2022
1 parent d123e78 commit 9b7800f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cmd/prommetric/metric.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package prommetric

import (
"fmt"
"time"
"log"

"github.com/prometheus/client_golang/prometheus"
)
Expand All @@ -15,7 +14,7 @@ type PromMeasure struct {
var (
TempGauge = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "temperature_celsius",
Help: "The temperature of the hen house in celsius.",
Help: "The temperature of the hen house in Celsius.",
})

HumGauge = prometheus.NewGauge(prometheus.GaugeOpts{
Expand All @@ -33,6 +32,5 @@ func (m PromMeasure) SetTempAndHum() {
TempGauge.Set(m.Temperature)
HumGauge.Set(m.Humidity)

fmt.Printf("%s: SetTempAndHum set values: Temperature: %f °C, Humidity: %f %%\n",
time.Now(), m.Temperature, m.Humidity)
log.Println("Set gauges: Temperature: %v°C, Humidity: %v%%", m.Temperature, m.Humidity)
}

0 comments on commit 9b7800f

Please sign in to comment.