Skip to content

subpop/go-log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

godocs.io Go Report Card

⚠️ Deprecated: use log/slog instead ⚠️

package log

Package log implements a simple level logging package that maintains API compatibility with the standard library log package. It extends the standard library log.Logger type with a Level type that can be used to define output verbosity. It adds additional methods that will be printed only if the logger is configured at or below a given level. For example:

package main

import "github.com/subpop/go-log"

func main() {
    log.SetLevel(log.LevelWarn)
    log.Traceln("Messages at LevelTrace will not print if the Level is Warn")
    log.Warnln("Messages at LevelTrace will print with the Level set to Warn")
}

About

simple level log package

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages