Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
bab2833cf7 | |||
564efef60b | |||
cb9d32bf1c |
9
.gitignore
vendored
9
.gitignore
vendored
@ -4,6 +4,7 @@
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
bin
|
||||
|
||||
# Test binary, built with `go test -c`
|
||||
*.test
|
||||
@ -13,3 +14,11 @@
|
||||
|
||||
# Dependency directories (remove the comment below to include it)
|
||||
# vendor/
|
||||
|
||||
# Go workspace file
|
||||
go.work
|
||||
|
||||
# General
|
||||
.DS_Store
|
||||
.idea
|
||||
.vscode
|
@ -2,6 +2,8 @@ package wrapper
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
@ -18,7 +20,7 @@ var (
|
||||
// DefaultLoggerObserver used to prepare labels for logger
|
||||
DefaultLoggerObserver = func(ctx context.Context, method string, query string, td time.Duration, err error) []interface{} {
|
||||
labels := []interface{}{"db.method", method, "took", fmt.Sprintf("%v", td)}
|
||||
if err != nil {
|
||||
if err != nil && !errors.Is(err, sql.ErrNoRows) {
|
||||
labels = append(labels, "error", err.Error())
|
||||
}
|
||||
if query != labelUnknown {
|
||||
|
Loading…
Reference in New Issue
Block a user