go-logging
go-logging copied to clipboard
Logger as interface, not struct?
Hello guys! I'm just wondering if you're considering to make Logger interface instead of struct. This can allow to switch between logger implementations.
Even PHP-world decided to develop convenient logger interface :)
I've been thinking about it before and sure. It does make sense.
Why do you need this though?
I just do not like to make my code library-dependent :). At the moment I'm using go-logging
library, but my clients may want to use something else.
Btw, I can send a pull request for this feature so we can discuss.
Regards.
@op interfaces are much more flexible to work with. strong +1 the context is a wonderful example of using interfaces for what would otherwise be concrete types: http://godoc.org/code.google.com/p/go.net/context
I agree too. Thanks for this lib, by the way.
I also agree. And again, thanks very much for this library!