Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/schollz/logger
Simplistic, opinionated logging for Golang
https://github.com/schollz/logger
golang library logging
Last synced: 4 days ago
JSON representation
Simplistic, opinionated logging for Golang
- Host: GitHub
- URL: https://github.com/schollz/logger
- Owner: schollz
- License: mit
- Created: 2019-05-07T22:53:54.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-12-17T23:15:51.000Z (almost 3 years ago)
- Last Synced: 2024-10-18T19:54:15.520Z (25 days ago)
- Topics: golang, library, logging
- Language: Go
- Size: 11.7 KB
- Stars: 21
- Watchers: 2
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# logger
Simplistic, opinionated logging for Golang
- Zero dependencies
- Global logger (with optional local logger)
- Leveled
- Useful defaults / i.e. zero-config
- Simple API
- Colors on Linux (Windows colors are horrible and unnecessary)
- Set leveling via environmental variables `LOGGER=trace|debug|info|warn|error````
[trace] 20:04:57.670116 logger.go:125: trace shows granular timestamp and line info
[debug] 20:04:57 logger.go:129: debug shows regular timestamp and line info
[info] 2019/05/08 20:04:57 info shows timestamp
[warn] 2019/05/08 20:04:57 warn shows timestamp
[error] 2019/05/08 20:04:57 logger.go:141: error shows timestamp and line info
```## Install
```
go get github.com/schollz/logger
```## Usage
```golang
package mainimport (
log "github.com/schollz/logger"
)func main() {
log.SetLevel("debug")
log.Debug("hello, world")
}
```## Contributing
Pull requests are welcome. Feel free to...
- Revise documentation
- Add new features
- Fix bugs
- Suggest improvements## License
MIT