Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/subpop/go-log
simple level log package
https://github.com/subpop/go-log
Last synced: 3 days ago
JSON representation
simple level log package
- Host: GitHub
- URL: https://github.com/subpop/go-log
- Owner: subpop
- License: gpl-3.0
- Created: 2020-09-18T21:54:30.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-25T02:23:01.000Z (3 months ago)
- Last Synced: 2024-11-15T23:38:20.394Z (2 months ago)
- Language: Go
- Homepage:
- Size: 34.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![godocs.io](http://godocs.io/github.com/subpop/go-log?status.svg)](http://godocs.io/github.com/subpop/go-log)
[![Go Report Card](https://goreportcard.com/badge/github.com/subpop/go-log)](https://goreportcard.com/report/github.com/subpop/go-log)# ⚠️ 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 mainimport "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")
}
```