go-telegram / bot

Telegram Bot API Go framework
MIT License
507 stars 46 forks source link

WithLogger() option is required #27

Closed Vasilesk closed 1 year ago

Vasilesk commented 1 year ago

WithLogger() bot option would be very cool for those who require structured log output

negasus commented 1 year ago

If you want to catch errors, you can use WithErrorsHandler option. I'll think about custom handler for debug messages.

I would not like to add the WithLogger option. I will be forced to come up with the most suitable interface, and anyway it will not suit everyone, I will have to write some adapters

Vasilesk commented 1 year ago

Thank you, WithErrorsHandler suits for errors but for debug it seems like everybody is forced to use global std logger 😅 So I suppose an alternative like interface with Debugf(template string, args ...interface{}) method would be quite nice, especially as an optional parameter. The signature seems to be quite popular. And those who don't like it still can write adapters by themselves, still better than global logger as an only option.

custom handler for debug messages

Sounds like something that will suit, I will wait for it then!

negasus commented 1 year ago

v0.7.5 is released