diff --git a/CHANGELOG.md b/CHANGELOG.md index 13b9e6d..e8a05ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### Others 1. [#68](https://github.com/InfluxCommunity/influxdb3-go/pull/68): Upgrade Go version to 1.22. +2. [#74](https://github.com/InfluxCommunity/influxdb3-go/pull/74): Use `log/slog` to print debug information instead of `fmt.Printf` ## 0.6.0 [2024-03-01] diff --git a/influxdb3/config.go b/influxdb3/config.go index 8943ae4..78a6aaf 100644 --- a/influxdb3/config.go +++ b/influxdb3/config.go @@ -25,11 +25,12 @@ package influxdb3 import ( "errors" "fmt" - "github.com/influxdata/line-protocol/v2/lineprotocol" "net/http" "net/url" "os" "strconv" + + "github.com/influxdata/line-protocol/v2/lineprotocol" ) const ( diff --git a/influxdb3/point_values.go b/influxdb3/point_values.go index 60aedae..a7099cd 100644 --- a/influxdb3/point_values.go +++ b/influxdb3/point_values.go @@ -24,6 +24,7 @@ package influxdb3 import ( "fmt" + "log/slog" "time" ) @@ -70,7 +71,7 @@ func (pv *PointValues) SetTimestamp(timestamp time.Time) *PointValues { // SetTag sets a tag value and returns the modified PointValues func (pv *PointValues) SetTag(name string, value string) *PointValues { if value == "" { - fmt.Printf("Empty tags has no effect, tag [%s], measurement [%s]\n", name, pv.MeasurementName) + slog.Debug(fmt.Sprintf("Empty tags has no effect, tag [%s], measurement [%s]", name, pv.MeasurementName)) } else { pv.Tags[name] = value }