Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added logging #74

Merged
merged 2 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
3 changes: 2 additions & 1 deletion influxdb3/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion influxdb3/point_values.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ package influxdb3

import (
"fmt"
"log/slog"
"time"
)

Expand Down Expand Up @@ -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
}
Expand Down