zap

package module
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: Apache-2.0 Imports: 7 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"

    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,
			ydbZap.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(log *zap.Logger, details trace.Details) (t trace.Coordination)

func Discovery added in v0.6.0

func Discovery(log *zap.Logger, details trace.Details) (t trace.Discovery)

func Driver

func Driver(l *zap.Logger, details trace.Details) trace.Driver

Driver makes trace.Driver with zap lging

func Ratelimiter added in v0.6.0

func Ratelimiter(log *zap.Logger, details trace.Details) (t trace.Ratelimiter)

func Retry added in v0.6.0

func Retry(log *zap.Logger, details trace.Details) (t trace.Retry)

func Scheme added in v0.6.0

func Scheme(log *zap.Logger, details trace.Details) (t trace.Scheme)

func Scripting added in v0.6.0

func Scripting(log *zap.Logger, details trace.Details) (t trace.Scripting)

func Table

func Table(log *zap.Logger, details trace.Details) trace.Table

Table makes trace.Table with zap logging

func WithTraces added in v0.6.0

func WithTraces(l *zap.Logger, details trace.Details) ydb.Option

Types

This section is empty.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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