opsgenie / opsgenie-go-sdk-v2

Opsgenie GO SDK v2
Apache License 2.0
34 stars 63 forks source link

fix #100: allow config to receive FieldLogger interface #101

Closed brensch closed 2 years ago

brensch commented 2 years ago

There is no way currently to add a set of fields to all logs from the opsgenie API since we are accepting a logrus.Logger in the config struct. By changing this to a FieldLogger users will be able to either continue submitting a logrus.Logger, or submit a logrus.Entry with a set of fields they want in all opsgenie logs predefined.

The only adverse effect is that the FieldLogger interface does not have a GetLevel method, meaning I've had to remove that from the printInfoLog function. This doesn't seem like an issue to me, would like opinions on this.