hudl / fargo

Golang client for Netflix Eureka
MIT License
133 stars 53 forks source link

Introducing a Logger interface for flexibility. #61

Closed martinbaillie closed 1 year ago

martinbaillie commented 7 years ago

Hi guys,

I was wondering if you would be interested in this PR to open up the logging used by Fargo?

I think providing this interface should allow consumers to roll their own logging solution if desired. That is, consumers may not be using op/go-logging and therefore can pass a wrapper to the new Set* funcs. This wrapper acts as a shim bridging the logging solution they're using.

I'm quite new to Go so there may have been a better way of opening up Fargo's logger flexibility. Please let me know and I can look into that.

Also, I matched all log levels offered by op/go-logging which does make the interface a little verbose. I'm aware Fargo is only using a few of the log levels internally and so the Fargo interface could have a few methods removed for brevity.