logrus

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

README

logrus

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

Usage

import (
	"context"
	"os"

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

	ydbLogrus "github.com/ydb-platform/ydb-go-sdk-logrus"
)

func main() {
	// init your logrus.Logger
	log := logrus.New(os.Stdout).With().Timestamp().Logger()

	db, err := ydb.Open(
		context.Background(),
		os.Getenv("YDB_CONNECTION_STRING"),
		ydbLogrus.WithTraces(
			&log,
			trace.DetailsAll,
		),
	)
	if err != nil {
		panic(err)
	}
	defer func() {
		_ = db.Close(context.Background())
	}()

	// work with db
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Coordination

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

func DatabaseSQL

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

func Discovery

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

func Driver

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

func Ratelimiter

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

func Scheme

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

func Scripting

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

func Table

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

func Topic

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

func WithLogger

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

func WithTraces

func WithTraces(l *logrus.Logger, d trace.Detailer, opts ...log.Option) 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