logger

package
v0.0.0-...-59d6468 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

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

func ErrorDetails

func ErrorDetails(err error)

func Info

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

func InitLogger

func InitLogger() error

func Trace

func Trace(format string, args ...interface{})

func Warn

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

func WarnDetails

func WarnDetails(err error)

Types

type Config

type Config struct {
	Sep         string
	PathPrefix  string
	Encoder     Encoder
	ErrorHooker ErrorHooker
	Target      io.Writer
	Level       Level
}

type Encoder

type Encoder interface {
	// contains filtered or unexported methods
}

type ErrorHooker

type ErrorHooker interface {
	// contains filtered or unexported methods
}

type ILogger

type ILogger interface {
	Trace(format string, args ...interface{})
	Info(format string, args ...interface{})
	Warn(format string, args ...interface{})
	Error(format string, args ...interface{})
	TracePath(path string, format string, args ...interface{})
	InfoPath(path string, format string, args ...interface{})
	WarnPath(path string, format string, args ...interface{})
	ErrorPath(path string, format string, args ...interface{})
	WarnDetailsPath(path string, err error)
	ErrorDetailsPath(path string, err error)
	WithValues(keysAndValues ...interface{}) ILogger
}

type JsonEncoder

type JsonEncoder struct {
	EnableBuffer bool
	// contains filtered or unexported fields
}

type Level

type Level int8
const (
	TraceLevel Level = iota - 1
	InfoLevel
	WarnLevel
	ErrorLevel
)

func (Level) CapitalString

func (l Level) CapitalString() string

type Logger

type Logger struct {
	// contains filtered or unexported fields
}
var CommonLogger *Logger

func NewLogger

func NewLogger(config Config) (*Logger, func() error, error)

func (*Logger) Error

func (l *Logger) Error(format string, args ...interface{})

func (*Logger) ErrorDetails

func (l *Logger) ErrorDetails(err error)

func (*Logger) ErrorDetailsPath

func (l *Logger) ErrorDetailsPath(path string, err error)

func (*Logger) ErrorPath

func (l *Logger) ErrorPath(path string, format string, args ...interface{})

func (*Logger) GetPath

func (l *Logger) GetPath() string

func (*Logger) Info

func (l *Logger) Info(format string, args ...interface{})

func (*Logger) InfoPath

func (l *Logger) InfoPath(path string, format string, args ...interface{})

func (*Logger) Trace

func (l *Logger) Trace(format string, args ...interface{})

func (*Logger) TracePath

func (l *Logger) TracePath(path string, format string, args ...interface{})

func (*Logger) Warn

func (l *Logger) Warn(format string, args ...interface{})

func (*Logger) WarnDetails

func (l *Logger) WarnDetails(err error)

func (*Logger) WarnDetailsPath

func (l *Logger) WarnDetailsPath(path string, err error)

func (*Logger) WarnPath

func (l *Logger) WarnPath(path string, format string, args ...interface{})

func (*Logger) WithValues

func (l *Logger) WithValues(kvs ...interface{}) ILogger

type PlainEncoder

type PlainEncoder struct {
	EnableBuffer bool
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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