logger

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Debugw(msg string, keysAndValues ...interface{})
	Infow(msg string, keysAndValues ...interface{})
	Warnw(msg string, keysAndValues ...interface{})
	Errorw(msg string, keysAndValues ...interface{})
	Fatalw(msg string, keysAndValues ...interface{})
	Panicw(msg string, keysAndValues ...interface{})
	With(keysAndValues ...interface{}) Logger
	Sync() error
	SafeSync()
}

Logger is a logging interface. It supports some of the methods of the zap.SugaredLogger interface.

func New

func New(opts ...Option) (Logger, error)

New returns a new Logger.

type Option

type Option func(*options) error

Option is an option for the logger.

func WithFormat

func WithFormat(format string) Option

WithFormat sets the format of the logger.

func WithLevel

func WithLevel(level string) Option

WithLevel sets the level of the logger.

func WithStacktrace added in v0.3.0

func WithStacktrace(stacktrace bool) Option

WithStacktrace sets the stacktrace of the logger.

Jump to

Keyboard shortcuts

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