https://github.com/opalmer/logrusutil
Provides basic wrappers and utility functions for logrus.
https://github.com/opalmer/logrusutil
go golang logging logrus logrus-hook
Last synced: about 1 month ago
JSON representation
Provides basic wrappers and utility functions for logrus.
- Host: GitHub
- URL: https://github.com/opalmer/logrusutil
- Owner: opalmer
- License: mit
- Created: 2017-09-10T14:41:55.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-20T00:13:39.000Z (over 8 years ago)
- Last Synced: 2025-08-14T02:52:19.373Z (11 months ago)
- Topics: go, golang, logging, logrus, logrus-hook
- Language: Go
- Size: 12.7 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Logrus Wrapper
[](https://travis-ci.org/opalmer/logrusutil)
[](https://codecov.io/gh/opalmer/logrusutil)
[](https://goreportcard.com/report/github.com/opalmer/logrusutil)
[](https://godoc.org/github.com/opalmer/logrusutil)
This project provides very basic wrappers for [logrus](https://github.com/sirupsen/logrus)
including:
* Log level parsing and handling.
* Hooks for adding additional information to log messages.
Contributions are welcome but before opening a PR consider if your request would
be better served as a contribution directly to the logrus project. This project
was initially created so a few different projects could share the same code.
```go
package main
import (
"github.com/opalmer/logrusutil"
"github.com/Sirupsen/logrus"
)
func main() {
// Setup the root logger and hooks.
if err := logrusutil.ConfigureLogger(logrus.StandardLogger(), logrusutil.NewConfig()); err != nil {
panic(err)
}
}
```
## Case Sensitivity
The logrus project was renamed at one point from:
github.com/Sirupsen/logrus
To:
github.com/sirupsen/logrus
This causes conflicts to occur in certain cases if one or more of your
dependencies are using the old import path. This project uses `sirupsen` which
reflects what the majority of projects are using today.