Skip to content

RevittCo/log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Log

License

Log is a simple go logging package that is a wrapper aroung slog.

Install

go get github.com/RevittCo/log

Handler Interface

You can create your own handler for use with this package. Just make it implement this interface.

type Handler interface {
    Enabled(ctx context.Context, l slog.Level) bool
    Handle(ctx context.Context, r slog.Record) error
    WithAttrs(attrs []slog.Attr) slog.Handler
    WithGroup(name string) slog.Handler
}

Usage

log.SetDefault(log.NewLogger(log.NewTerminalHandler(os.Stdout, log.LevelInfo)))
log.Info("logger initialised")

About

simple logging go package

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages