zgocb

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultLevelMap is the default map that will be used if Adapter is constructed with "NewDefault"
	// Change as makes sense to your app.
	DefaultLevelMap = LevelMap{
		gocb.LogMaxVerbosity: zerolog.Disabled,
		gocb.LogSched:        zerolog.Disabled,
		gocb.LogTrace:        zerolog.TraceLevel,
		gocb.LogDebug:        zerolog.DebugLevel,
		gocb.LogInfo:         zerolog.InfoLevel,
		gocb.LogWarn:         zerolog.WarnLevel,
		gocb.LogError:        zerolog.ErrorLevel,
	}
)

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter implements gocb.Logger, allowing for a ZeroLog logger to be used.

func New

func New(levelMap LevelMap, logger zerolog.Logger) *Adapter

New initializes a new Adapter with the specified level map

func NewDefault

func NewDefault(logger zerolog.Logger) *Adapter

NewDefault creates a new adapter with the default LevelMap

func (*Adapter) Log

func (a *Adapter) Log(level gocb.LogLevel, _ int, f string, v ...interface{}) error

Log translates the gocb log level to a zerolog event based upon the event map created with the Adapter

type LevelMap

type LevelMap map[gocb.LogLevel]zerolog.Level

LevelMap is used to translate GOCB log levels to ZeroLog levels

Jump to

Keyboard shortcuts

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