Help us shape the future of Go! Take the 2026 Go Developer Survey

log

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(s Struct, a ...any)

func Debugf

func Debugf(s Struct, format string, a ...any)

func Error

func Error(s Struct, a ...any)

func Errorf

func Errorf(s Struct, format string, a ...any)

func Info

func Info(s Struct, a ...any)

Spaces will not like the fmt.Println() that added between operands and a newline is appended. add spaces between operands to achieve the same effect:

Info(Struct{"test","log.Info()"},"here is a testing", " ", "log.Info()")

func Infof

func Infof(s Struct, format string, a ...any)

func Msg

func Msg(a ...any) string

func Msgf

func Msgf(format string, a ...any) string

func NewEnhanceHandler

func NewEnhanceHandler(h slog.Handler, calldepth int) slog.Handler

func Warn

func Warn(s Struct, a ...any)

func Warnf

func Warnf(s Struct, format string, a ...any)

Types

type EnhanceHandler

type EnhanceHandler struct {
	slog.Handler
	// contains filtered or unexported fields
}

func (*EnhanceHandler) Handle

func (eh *EnhanceHandler) Handle(ctx context.Context, r slog.Record) error

type EnhanceLogger

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

func New

func New(handleType, level, timeLayout string, shortSourceFile bool, calldepth int, out io.Writer) *EnhanceLogger

func (*EnhanceLogger) Debug

func (el *EnhanceLogger) Debug(s Struct, a ...any)

func (*EnhanceLogger) Debugf

func (el *EnhanceLogger) Debugf(s Struct, format string, a ...any)

func (*EnhanceLogger) Error

func (el *EnhanceLogger) Error(s Struct, a ...any)

func (*EnhanceLogger) Errorf

func (el *EnhanceLogger) Errorf(s Struct, format string, a ...any)

func (*EnhanceLogger) Info

func (el *EnhanceLogger) Info(s Struct, a ...any)

func (*EnhanceLogger) Infof

func (el *EnhanceLogger) Infof(s Struct, format string, a ...any)

func (*EnhanceLogger) Warn

func (el *EnhanceLogger) Warn(s Struct, a ...any)

func (*EnhanceLogger) Warnf

func (el *EnhanceLogger) Warnf(s Struct, format string, a ...any)

type Struct

type Struct []any

Jump to

Keyboard shortcuts

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