log

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(format string, args ...any)

func DebugW

func DebugW(msg string, args ...any)

func Error

func Error(format string, args ...any)

func ErrorW

func ErrorW(msg string, args ...any)

func Fatal

func Fatal(format string, args ...any)

func FatalW

func FatalW(msg string, args ...any)

func Info

func Info(format string, args ...any)

func InfoW

func InfoW(msg string, args ...any)

func Warn

func Warn(format string, args ...any)

func WarnW

func WarnW(msg string, args ...any)

Types

type Config

type Config struct {
	App    string            `json:"app,omitempty" yaml:"app"`
	Format string            `json:"format,omitempty" yaml:"format"` // text(default) json
	Level  string            `json:"level,omitempty" yaml:"level"`   // debug(default) < info < warn < error
	Stdout bool              `json:"stdout,omitempty" yaml:"stdout"`
	Rotate lumberjack.Logger `json:"rotate" yaml:"rotate"`
}

func (*Config) Validate

func (c *Config) Validate() error

type Logger

type Logger struct {
	// contains filtered or unexported fields
}
var (
	Default *Logger
)

func New

func New(cfg *Config) *Logger

func (*Logger) Close

func (l *Logger) Close() error

func (*Logger) Logger

func (l *Logger) Logger() *slog.Logger

func (*Logger) SetLevel

func (l *Logger) SetLevel(level slog.Level)

Jump to

Keyboard shortcuts

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