Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use syslog hook in example_hook_test.go #809

Closed
thsnr opened this issue Aug 23, 2018 · 1 comment · Fixed by #816
Closed

Use syslog hook in example_hook_test.go #809

thsnr opened this issue Aug 23, 2018 · 1 comment · Fixed by #816
Assignees

Comments

@thsnr
Copy link

thsnr commented Aug 23, 2018

Currently example_hook_test.go uses gopkg.in/gemnasium/logrus-airbrake-hook.v2 to demonstrate using hooks. This is a very heavy import and with the introduction of Go modules will propagate to all projects using logrus.

For example, if I set logrus as a dependency to my Go module and run go build then the following build dependencies are added to my requirements:

github.com/sirupsen/logrus v1.0.6
golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac // indirect

However, when running go mod tidy to add all transitive dependencies (including testing), then I get these following additional lines:

github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.4.7 // indirect
github.com/golang/protobuf v1.2.0 // indirect
github.com/hpcloud/tail v1.0.0 // indirect
github.com/onsi/ginkgo v1.6.0 // indirect
github.com/onsi/gomega v1.4.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/testify v1.2.2 // indirect
golang.org/x/net v0.0.0-20180821023952-922f4815f713 // indirect
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f // indirect
golang.org/x/text v0.3.0 // indirect
gopkg.in/airbrake/gobrake.v2 v2.0.9 // indirect
gopkg.in/fsnotify.v1 v1.4.7 // indirect
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.2.1 // indirect

All because of gopkg.in/gemnasium/logrus-airbrake-hook.v2.

I suggest using github.com/sirupsen/logrus/hooks/syslog in the example instead: it demonstrates using hooks just as well and does not result in any additional dependencies.

@dgsb dgsb self-assigned this Sep 2, 2018
@dgsb
Copy link
Collaborator

dgsb commented Sep 2, 2018

Indeed

dgsb added a commit that referenced this issue Sep 2, 2018
The purpose is to reduce package dependencies, fixes #809.
@dgsb dgsb closed this as completed in #816 Sep 4, 2018
cgxxv pushed a commit to cgxxv/logrus that referenced this issue Mar 25, 2022
The purpose is to reduce package dependencies, fixes sirupsen#809.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants