Skip to content

Commit

Permalink
Merge pull request #1531 returned field methods to public
Browse files Browse the repository at this point in the history
returned field methods to public
  • Loading branch information
rekby authored Oct 25, 2024
2 parents 25a0667 + c5fb45e commit d09736f
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* Returned log.XXX methods for create fields, removed from public at v3.85.0

## v3.89.1
* Added option `ydb.WithSharedBalancer(*Driver)` for child drivers

Expand Down
43 changes: 43 additions & 0 deletions log/field.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package log

import (
"fmt"
"time"

"github.com/ydb-platform/ydb-go-sdk/v3/internal/kv"
)

Expand All @@ -27,3 +30,43 @@ func appendFieldByCondition(condition bool, ifTrueField Field, fields ...Field)

return fields
}

func String(k, v string) Field {
return kv.String(k, v)
}

func Int(k string, v int) Field {
return kv.Int(k, v)
}

func Int64(k string, v int64) Field {
return kv.Int64(k, v)
}

func Bool(k string, v bool) Field {
return kv.Bool(k, v)
}

func Duration(k string, v time.Duration) Field {
return kv.Duration(k, v)
}

func Strings(k string, v []string) Field {
return kv.Strings(k, v)
}

func NamedError(k string, v error) Field {
return kv.NamedError(k, v)
}

func Error(v error) Field {
return kv.Error(v)
}

func Any(k string, v any) Field {
return kv.Any(k, v)
}

func Stringer(k string, v fmt.Stringer) Field {
return kv.Stringer(k, v)
}

0 comments on commit d09736f

Please sign in to comment.