log

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Crit

func Crit(msg string, ctx ...interface{})

Crit is a convenient alias for Root().Crit

func Debug

func Debug(msg string, ctx ...interface{})

Debug is a convenient alias for Root().Debug

func Error

func Error(msg string, ctx ...interface{})

Error is a convenient alias for Root().Error

func GetHandler

func GetHandler() log15.Handler

func Info

func Info(msg string, ctx ...interface{})

Info is a convenient alias for Root().Info

func Module15

func Module15(module string) log15.Logger

func SetHandler

func SetHandler(h log15.Handler)

func StackError

func StackError(msg string, ctx error)

func Trace

func Trace(msg string, ctx ...interface{})

Trace is a convenient alias for Root().Trace

func Warn

func Warn(msg string, ctx ...interface{})

Warn is a convenient alias for Root().Warn

func WithContext

func WithContext(ctx context.Context, l Logger) context.Context

WithContext context log

Types

type Logger

type Logger interface {
	log15.Logger
	Trace(msg string, ctx ...interface{})
	NewLogger(ctx ...interface{}) Logger
	SetLevel(lvl log15.Lvl) Logger
	SetLevelString(lvlString string) Logger
	NewContextLogger(c context.Context, ctx ...interface{}) (context.Context, Logger)
}

func Module

func Module(module string) Logger

func New

func New(ctx ...interface{}) Logger

New returns a new logger with the given context. New is a convenient alias for Root().New

func Root

func Root() Logger

Root returns the root logger

func SetLevel

func SetLevel(lvl log15.Lvl) Logger

func SetLevelString

func SetLevelString(lvlString string) Logger

Jump to

Keyboard shortcuts

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