lorenzodonini / ocpp-go

Open Charge Point Protocol implementation in Go
MIT License
262 stars 125 forks source link

Remove logrus from core library #40

Closed andig closed 3 years ago

andig commented 3 years ago

Fix #39

andig commented 3 years ago

PR compiles now, setting the error handler is still missing. Up for discussion ;)

andig commented 3 years ago

ping @lorenzodonini is this going in the direction you want? Anything I could fix?

andig commented 3 years ago

I've rebased.

Biggest improvement I could see is to use a custom error struct. It's very useful to pass information like chargePointID and FeatureName as separate fields, so they can be used independently afterwards. What do you think?

I will add Go 1.13 errors with additional information.

lorenzodonini commented 3 years ago

I've rebased.

Nice!

Biggest improvement I could see is to use a custom error struct. It's very useful to pass information like chargePointID and FeatureName as separate fields, so they can be used independently afterwards. What do you think?

I will add Go 1.13 errors with additional information.

@andig You wanna do this in a separate PR? We could merge this one in the meantime and I'll create a separate issue for the custom error structs.

andig commented 3 years ago

Yes, can do. Afaik even structured errors should still be errors so no API break. At least that's what I hope to do...

andig commented 3 years ago

Then lets merge this and I‘ll upgrade the errors in a separate step. Still desperately looking for ws reconnect ;)

lorenzodonini commented 3 years ago

@andig merged and created issue #47 as a follow-up. Definitely not high priority, but in case you want to help out, I'll appreciate!

Btw, auto-reconnect is working, just verifying network tests and potential race conditions.