jcelliott / turnpike

Go implementation of a WAMP (Web Application Messaging Protocol) client and router
MIT License
258 stars 88 forks source link

Report errors #54

Closed beatgammit closed 9 years ago

beatgammit commented 10 years ago

When fixing #53, I found that most of debugging information I wanted was in the errors returned from functions. We don't currently report these (e.g. in websocket.go) or even log them.

I think this was mainly due to not wanting a hard dependency on lumber, but the result is that it never got done. We need to decide how to report errors and implement it.

jcelliott commented 10 years ago

One possible solution would be to define a Logger interface for an object that can be passed in and used for logging. Ideally this would work out of the box with the standard Go log package. We could also optionally support logging with levels.

We should also do some research to see what other projects have done to solve this problem.

jcelliott commented 10 years ago

This is an interesting approach to this issue:

https://github.com/visionmedia/go-debug

beatgammit commented 10 years ago

Interesting. That author is a node.js dev (author of jade, express and a few other notables), so it looks like he's getting into go now?

jcelliott commented 9 years ago

91 Added a Logger interface and the ability to inject your own logger. I think this is good enough for now.