-
Notifications
You must be signed in to change notification settings - Fork 20
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
CloverConnector connecting to Clover Mini before calling initializeConnection #143
Comments
@DyegoCosta, no, this is not the expected behavior and I cannot reproduce it. Using the remote-pay-cloud-starter I commented out the line where initializeConnection is called as expected onDeviceReady is never called. There must be something else going on. |
@david-clover-com Thanks, I found the issue! I was calling
Do you have any tip on how to properly listen to the Connector's logs? Or should it be done like that after |
Does: work for you? |
@david-clover-com I already do that, and it works to send logs to the console, but I need a way to listen to the logs so I can redirect them to a log management service provider. Something like this:
^ this works but with the side effect of initializing the connection early |
I see. The short answer is that because the device is not created until initialize/initializeConnection is called, you cannot cleanly intercept calls to the device's logger before that time. This is probably the approach you want to take as the logging you may miss is likely minimal and not material. The long, ugly, and not recommended answer is that the Logger is publicly exposed and could be intercepted. However this would introduce an ugly dependency on the Connector's inner API. Something like this should work:
|
Thanks @david-clover-com! I'll weight my options here after some tests. It would be great if the SDK provided a more straight forward logging API. I see there's a lot of logger instances and took me a while to find the correct one I want to watch. (e.g |
Thanks for the feedback. I created an internal issue for us to improve our log framework. |
@david-clover-com I noticed we can use |
* Final publish release pipeline
SDK v1.4.2
I just noticed the CloverConnector is establishing a connection with the Clover Mini right after I add any listener to it, before calling
ICloverConnector#initializeConnection
.To reproduce:
onDeviceReady
to be calledICloverConnector#sale
Is this the expected behaviour? If so, what should
initializeConnection
be used for?The text was updated successfully, but these errors were encountered: