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
Add logging option for btcrpcclient as subsystem RPCC. #328
Conversation
Nice find, without this all logs in the btcrpcclient package get eaten and there's no way of turning it back on. ok |
No real objections, although I wonder if the chain subsystem should tell the btcrpcclient to use its logger instead of having a separate subsystem? Allowing it to be specified separately doesn't hurt currently, but ultimately wallet will be able to work with both the current websockets RPC model as well as SPV in which case there will be no btcrpcclient dep. EDIT: We can of course address that at the time SPV support gets merged as well. |
I'll make it inherit chain's logger if you think that's better. The way I understand you, it will be set to whatever chain logging is set to, and not have it's own label. Is that correct? |
Yeah it would all show up as "CHNS". case "CHNS":
chainLog = logger
chain.UseLogger(logger)
+ btcrpcclient.UseLogger(logger) For what it's worth, I'm not really against it being like you have it now as a separate subsystem either, but I brought it up as a point of discussion since it might make sense to avoid a separate subsystem given the SPV plans. What do you think @jrick? |
Everything is set to the info level by default. If btcrpcclient shared the same logger as the chain package then there would be a lot more logging going on by default without any change in config. I'm not totally opposed to that but it depends how verbose it actually is. |
The logging is quite light for |
Seems that sharing the logger with chain would be ok then, except perhaps we want to remove the duplicate log when it connects ("Established websocket RPC connection to btcd"). |
Wouldn't that be the same if it's added with a separate subsystem label (assuming that the new label also defaults to info level)? As for noise level, it seems pretty ok at info and above. Info level messages are logged for connect/disconnect only. As far as I can tell the biggest risk of log spam comes from warnings of invalid messages (eg. https://github.com/btcsuite/btcrpcclient/blob/master/notify.go#L199), although I don't know btcwallet well enough yet to judge how frequent those can be. |
Sorry, didn't see Dave's reply before replying myself. I'm going to change On Thu, 19 Nov 2015 at 16:40 Josh Rickmar notifications@github.com wrote:
|
OK |
ok. Can you squash this into a single commit? |
Logging from btcrpcclient is currently not possible to set, and defaults to nothing. Letting it inherit chain's logger can greatly simplify debugging of connectivity issues. Also remove a now redundant log message upon connecting to btcd.
Sure. |
Add 'version: master' to all btcsuite and decred projects, since we always want the latest versions of these. This works around a bug in the latest version of glide where it does not track the master branch correctly. Update gRPC for the 1.0.0 release and update bolt to 1.3.0 to pick up a fix for a memory handling error that was exposed by the Go 1.7 SSA compiler backend. Fixes btcsuite#325. Fixes btcsuite#328.
Add 'version: master' to all btcsuite and decred projects, since we always want the latest versions of these. This works around a bug in the latest version of glide where it does not track the master branch correctly. Update gRPC for the 1.0.0 release and update bolt to 1.3.0 to pick up a fix for a memory handling error that was exposed by the Go 1.7 SSA compiler backend. Fixes btcsuite#325. Fixes btcsuite#328.
This isn't really a subsystem, rather a dependency, but being able to
turn the logging on from the command line can greatly simplify debugging
of connectivity issues.