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

Logger as interface, not struct? #18

Open
elgris opened this issue Jul 11, 2014 · 5 comments
Open

Logger as interface, not struct? #18

elgris opened this issue Jul 11, 2014 · 5 comments

Comments

@elgris
Copy link

elgris commented Jul 11, 2014

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 :)

@op
Copy link
Owner

op commented Jul 12, 2014

I've been thinking about it before and sure. It does make sense.

Why do you need this though?

@elgris
Copy link
Author

elgris commented Jul 16, 2014

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.

@jbenet
Copy link

jbenet commented Sep 19, 2014

@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

@mrsinham
Copy link

mrsinham commented Oct 9, 2014

I agree too. Thanks for this lib, by the way.

@JamesHaskell
Copy link

I also agree. And again, thanks very much for this library!

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

5 participants