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

Vendored dependency for logrus #74

Open
bebehei opened this issue Dec 12, 2020 · 0 comments
Open

Vendored dependency for logrus #74

bebehei opened this issue Dec 12, 2020 · 0 comments

Comments

@bebehei
Copy link

bebehei commented Dec 12, 2020

Hi all,

according to the Opsgenie docs, there is the possibility to control the LogLevel while initializing the api client.

But sadly, the used logrus is a vendored dependency for OpsGenie.

  • using import "github.com/opsgenie/opsgenie-go-sdk-v2/vendor/github.com/sirupsen/logrus" fails because, it's a vendored dependency
  • using import "import "github.com/sirupsen/logrus" fails, because the types for LogLevel won't match.

So, there is no currently possibility to pass LogLevel to the opsgenie golang library.

I'm a golang freshman and I don't understand the concept of vendored dependencies and especially their design decisions.

But I see a few ways to proceed:

  • Remove logrus from the vendor directory in the opsgenie API. According to my tests, this works fine.
  • Hide the vendored logrus (and pass LogLevel types from the opsgenie API).
  • Do some weird hacking in the GOPATH mv $GOPATH/src/github.com/opsgenie/opsgenie-go-sdk-v2/vendor/github.com/sirupsen $GOPATH/src/github.com (but this can't be the solution)
  • ? something else

What is the favorite way to solve this problem and be able to pass a LogLevel to the api client?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant