log

package
v0.0.0-...-d16b773 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultLogger = NewStdLogger(log.Writer())
)

Functions

This section is empty.

Types

type Entry

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

Entry is logger entry

func NewEntry

func NewEntry(logger Logger) *Entry

func (*Entry) Debug

func (e *Entry) Debug(v ...interface{})

func (*Entry) Debugf

func (e *Entry) Debugf(format string, v ...interface{})

func (*Entry) Info

func (e *Entry) Info(v ...interface{})

func (*Entry) Infof

func (e *Entry) Infof(format string, v ...interface{})

func (*Entry) WithTraceId

func (e *Entry) WithTraceId(traceId string) *Entry

WithTraceId set trace id

type Helper

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

Helper is a helper logger

func NewHelper

func NewHelper(logger Logger) *Helper

func (*Helper) Debug

func (h *Helper) Debug(v ...interface{})

func (*Helper) Debugf

func (h *Helper) Debugf(format string, v ...interface{})

func (*Helper) Error

func (h *Helper) Error(v ...interface{})

func (*Helper) Errorf

func (h *Helper) Errorf(format string, v ...interface{})

func (*Helper) Info

func (h *Helper) Info(v ...interface{})

func (*Helper) Infof

func (h *Helper) Infof(format string, v ...interface{})

func (*Helper) Log

func (h *Helper) Log(level Level, v ...interface{}) error

func (*Helper) Warn

func (h *Helper) Warn(v ...interface{})

func (*Helper) Warnf

func (h *Helper) Warnf(format string, v ...interface{})

func (*Helper) WithTraceId

func (h *Helper) WithTraceId(traceId string) *Entry

type Level

type Level uint8
const (
	Debug Level = iota
	Info
	Warn
	Error
	Fatal
)

func ParseLevel

func ParseLevel(s string) Level

ParseLevel .

func (Level) String

func (l Level) String() string

type Logger

type Logger interface {
	Log(level Level, v ...interface{})
}

Logger is a logger interface

func NewStdLogger

func NewStdLogger(w io.Writer) Logger

NewStdLogger new a logger with writer.

Jump to

Keyboard shortcuts

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