package log

import "github.com/ydb-platform/ydb-go-sdk/v3/log"

Index

Constants

const (
	IntType      = kv.IntType
	Int64Type    = kv.Int64Type
	StringType   = kv.StringType
	BoolType     = kv.BoolType
	DurationType = kv.DurationType
	StringsType  = kv.StringsType
	ErrorType    = kv.ErrorType
	AnyType      = kv.AnyType
	StringerType = kv.StringerType
)
const (
	TRACE = Level(iota)
	DEBUG
	INFO
	WARN
	ERROR
	FATAL

	QUIET
)

Functions

func Coordination

func Coordination(l Logger, d trace.Detailer, opts ...Option) (t trace.Coordination)

Coordination makes trace.Coordination with logging events from details

func DatabaseSQL

func DatabaseSQL(l Logger, d trace.Detailer, opts ...Option) (t trace.DatabaseSQL)

DatabaseSQL makes trace.DatabaseSQL with logging events from details

func Default

func Default(w io.Writer, opts ...simpleLoggerOption) *defaultLogger

func Discovery

func Discovery(l Logger, d trace.Detailer, opts ...Option) (t trace.Discovery)

Discovery makes trace.Discovery with logging events from details

func Driver

func Driver(l Logger, d trace.Detailer, opts ...Option) (t trace.Driver)

Driver makes trace.Driver with logging events from details

func NamesFromContext

func NamesFromContext(ctx context.Context) []string

func Query

func Query(l Logger, d trace.Detailer, opts ...Option) (t trace.Query)

Query makes trace.Query with logging events from details

func Ratelimiter

func Ratelimiter(l Logger, d trace.Detailer, opts ...Option) (t trace.Ratelimiter)

Ratelimiter returns trace.Ratelimiter with logging events from details

func Retry

func Retry(l Logger, d trace.Detailer, opts ...Option) (t trace.Retry)

Retry returns trace.Retry with logging events from details

func Scheme

func Scheme(l Logger, d trace.Detailer, opts ...Option) (t trace.Scheme)

Scheme returns trace.Scheme with logging events from details

func Scripting

func Scripting(l Logger, d trace.Detailer, opts ...Option) (t trace.Scripting)

Scripting returns trace.Scripting with logging events from details

func Table

func Table(l Logger, d trace.Detailer, opts ...Option) (t trace.Table)

Table makes trace.Table with logging events from details

func Topic

func Topic(l Logger, d trace.Detailer, opts ...Option) (t trace.Topic)

Topic returns trace.Topic with logging events from details

func WithColoring

func WithColoring() simpleLoggerOption

func WithLevel

func WithLevel(ctx context.Context, lvl Level) context.Context

func WithLogQuery

func WithLogQuery() logQueryOption

func WithMinLevel

func WithMinLevel(level Level) simpleLoggerOption

func WithNames

func WithNames(ctx context.Context, names ...string) context.Context

Types

type Field

type Field = kv.KeyValue

type Level

type Level int

func FromString

func FromString(l string) Level

func LevelFromContext

func LevelFromContext(ctx context.Context) Level

func (Level) BoldColor

func (l Level) BoldColor() string

func (Level) Color

func (l Level) Color() string

func (Level) String

func (l Level) String() string

type Logger

type Logger interface {
	// Log logs the message with specified options and fields.
	// Implementations must not in any way use slice of fields after Log returns.
	Log(ctx context.Context, msg string, fields ...Field)
}

type Mapper

type Mapper interface {
	MapLogLevel(level Level) Level
}

type Option

type Option interface {
	// contains filtered or unexported methods
}

Source Files

context.go coordination.go discovery.go driver.go field.go level.go logger.go options.go query.go ratelimiter.go retry.go scheme.go scripting.go sql.go table.go topic.go

Version
v3.88.0
Published
Oct 23, 2024
Platform
linux/amd64
Imports
13 packages
Last checked
32 minutes ago

Tools for package owners.