zap

package module
v0.16.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2023 License: Apache-2.0 Imports: 6 Imported by: 1

README

zap

zap package helps to create ydb-go-sdk traces with logging driver events with zap

Usage

import (
    "fmt"
    "sync/mutex"
    "time"

    "go.uber.org/zap"

    "github.com/ydb-platform/ydb-go-sdk/v3"
    "github.com/ydb-platform/ydb-go-sdk/v3/trace"

    ydbZap "github.com/ydb-platform/ydb-go-sdk-zap"
)

func main() {
    // init your zap.Logger
    log, err := zap.NewProduction()
	
    db, err := ydb.Open(context.Background(),
        os.Getenv("YDB_CONNECTION_STRING"),
        ydbZap.WithTraces(
            log,
            trace.DetailsAll,
        ),
    )
    // work with db
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Coordination added in v0.6.0

func Coordination(l *zap.Logger, d trace.Detailer, opts ...log.Option) trace.Coordination

func DatabaseSQL added in v0.9.8

func DatabaseSQL(l *zap.Logger, d trace.Detailer, opts ...log.Option) trace.DatabaseSQL

func Discovery added in v0.6.0

func Discovery(l *zap.Logger, d trace.Detailer, opts ...log.Option) trace.Discovery

func Driver

func Driver(l *zap.Logger, d trace.Detailer, opts ...log.Option) trace.Driver

func Fields added in v0.16.0

func Fields(fields []log.Field) []zap.Field

func Level added in v0.16.0

func Level(ctx context.Context) zapcore.Level

func Ratelimiter added in v0.6.0

func Ratelimiter(l *zap.Logger, d trace.Detailer, opts ...log.Option) trace.Ratelimiter

func Scheme added in v0.6.0

func Scheme(l *zap.Logger, d trace.Detailer, opts ...log.Option) trace.Scheme

func Scripting added in v0.6.0

func Scripting(l *zap.Logger, d trace.Detailer, opts ...log.Option) trace.Scripting

func Table

func Table(l *zap.Logger, d trace.Detailer, opts ...log.Option) trace.Table

func Topic added in v0.9.8

func Topic(l *zap.Logger, d trace.Detailer, opts ...log.Option) trace.Topic

func WithLogger added in v0.16.0

func WithLogger(l *zap.Logger, d trace.Detailer, opts ...Option) ydb.Option

func WithTraces added in v0.6.0

func WithTraces(l *zap.Logger, d trace.Detailer, opts ...Option) ydb.Option

Types

type Option added in v0.16.0

type Option = log.Option

func WithLogQuery added in v0.9.8

func WithLogQuery() Option

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL