Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/segment-boneyard/go-log
Go core-like logger with levels and default logger
https://github.com/segment-boneyard/go-log
Last synced: about 5 hours ago
JSON representation
Go core-like logger with levels and default logger
- Host: GitHub
- URL: https://github.com/segment-boneyard/go-log
- Owner: segment-boneyard
- Created: 2014-07-18T15:04:36.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-22T02:44:22.000Z (almost 10 years ago)
- Last Synced: 2024-09-28T06:48:00.502Z (about 2 months ago)
- Language: Go
- Size: 327 KB
- Stars: 58
- Watchers: 42
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# go-log
Simple printf-style logger which is more or less the same as Go's core
logger with log levels.View the [docs](http://godoc.org/github.com/segmentio/go-log).
## Example
```go
log.Debug("something")
log.Emergency("hello %s %s", "tobi", "ferret")l := log.New(os.Stderr, log.DEBUG, "")
l.Debug("something happened")
l.Info("hello %s", "Tobi")
l.Error("boom something exploded")
```## Conventions
Typically you'll want to "inherit" from a parent logger, this allows
for setting changes at the root of your application to trickle down.To do this you can use `Logger.New(prefix string)`, for example here
a child logger is created by calling `.New()` on the standard logger:```go
var log = log.Log.New("mylib")
```## License
MIT