logger

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: Apache-2.0 Imports: 9 Imported by: 70

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Critical

func Critical(ctx context.Context, format string, v ...interface{})

func Debug

func Debug(ctx context.Context, format string, v ...interface{})

func Error

func Error(ctx context.Context, format string, v ...interface{})

func Info

func Info(ctx context.Context, format string, v ...interface{})

func SetLevelByString

func SetLevelByString(level string)

func SetOutput

func SetOutput(output io.Writer)

func Warn

func Warn(ctx context.Context, format string, v ...interface{})

Types

type Level

type Level uint32
const (
	CriticalLevel Level = iota
	ErrorLevel
	WarnLevel
	InfoLevel
	DebugLevel
)

func StringToLevel

func StringToLevel(level string) Level

func (Level) String

func (level Level) String() string

type Logger

type Logger struct {
	Level Level
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger() *Logger

func (*Logger) Critical

func (logger *Logger) Critical(ctx context.Context, format string, args ...interface{})

func (*Logger) Debug

func (logger *Logger) Debug(ctx context.Context, format string, args ...interface{})

func (*Logger) Error

func (logger *Logger) Error(ctx context.Context, format string, args ...interface{})

func (*Logger) HideCallstack

func (logger *Logger) HideCallstack() *Logger

func (*Logger) Info

func (logger *Logger) Info(ctx context.Context, format string, args ...interface{})

func (*Logger) SetLevel

func (logger *Logger) SetLevel(level Level)

func (*Logger) SetLevelByString

func (logger *Logger) SetLevelByString(level string)

func (*Logger) SetOutput

func (logger *Logger) SetOutput(output io.Writer) *Logger

func (*Logger) Warn

func (logger *Logger) Warn(ctx context.Context, format string, args ...interface{})

func (*Logger) WithDepth added in v0.1.7

func (logger *Logger) WithDepth(depth int) *Logger

Jump to

Keyboard shortcuts

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