fix: remove logging from utils
This commit was merged in pull request #292.
This commit is contained in:
26
log/default.go
Normal file
26
log/default.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package log
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promauto"
|
||||
)
|
||||
|
||||
var (
|
||||
errorMetric = promauto.NewCounter(
|
||||
prometheus.CounterOpts{
|
||||
Name: "mefit_error_total",
|
||||
Help: "The total number of errors during processing",
|
||||
},
|
||||
)
|
||||
)
|
||||
|
||||
func Error(message string, err error) {
|
||||
slog.Error(message + ": " + err.Error())
|
||||
errorMetric.Inc()
|
||||
}
|
||||
func ErrorMsg(message string) {
|
||||
slog.Error(message)
|
||||
errorMetric.Inc()
|
||||
}
|
||||
Reference in New Issue
Block a user