logs

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: Apache-2.0 Imports: 5 Imported by: 32

Documentation

Index

Constants

View Source
const (
	LevelDebug = 1 + iota
	LevelInfo
	LevelWarn
	LevelError
)

Variables

This section is empty.

Functions

func Debug

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

func Debugf

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

func Error

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

func Errorf

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

func Flush

func Flush()

func Info

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

func Infof

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

func SetLevel

func SetLevel(level int)

func SetLogger

func SetLogger(logger Logger)

func Warn

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

func Warnf

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

Types

type Logger

type Logger interface {
	Debugf(format string, v ...interface{})
	Infof(format string, v ...interface{})
	Warnf(format string, v ...interface{})
	Errorf(format string, v ...interface{})
	Flush()
	SetLevel(level int) error
}

TODO: merge with hertz logger package

type StdLogger

type StdLogger struct {
	Defer   bool
	ErrOnly bool
	// contains filtered or unexported fields
}

func NewStdLogger

func NewStdLogger(level int) *StdLogger

func (*StdLogger) Debugf

func (stdLogger *StdLogger) Debugf(format string, v ...interface{})

func (*StdLogger) Err

func (stdLogger *StdLogger) Err() string

func (*StdLogger) Errorf

func (stdLogger *StdLogger) Errorf(format string, v ...interface{})

func (*StdLogger) Flush

func (stdLogger *StdLogger) Flush()

func (*StdLogger) FlushErr

func (stdLogger *StdLogger) FlushErr()

func (*StdLogger) FlushOut

func (stdLogger *StdLogger) FlushOut()

func (*StdLogger) Infof

func (stdLogger *StdLogger) Infof(format string, v ...interface{})

func (*StdLogger) Out

func (stdLogger *StdLogger) Out() []byte

func (*StdLogger) OutLines

func (stdLogger *StdLogger) OutLines() []string

func (*StdLogger) SetLevel

func (stdLogger *StdLogger) SetLevel(level int) error

func (*StdLogger) Warn

func (stdLogger *StdLogger) Warn() string

func (*StdLogger) Warnf

func (stdLogger *StdLogger) Warnf(format string, v ...interface{})

Jump to

Keyboard shortcuts

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