You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Despite Go's poor design in not providing a standard Logger interface, we can still achieve a unified Logger instance by customizing the Logger interface. For example, I prefer using JSON logs for easy log collection.
Later on, you only need to provide a Logger option when creating the robot (we can implement the Logger interface you require), and you can provide a default logger implementation at creation. I believe such changes are not very invasive.
The text was updated successfully, but these errors were encountered:
All the log calls are adjustable: you can write your own middleware for logging incoming requests with the logger package you like. There is also a Bot.OnError field to override the error-handler.
Despite Go's poor design in not providing a standard Logger interface, we can still achieve a unified Logger instance by customizing the Logger interface. For example, I prefer using JSON logs for easy log collection.
Example
Later on, you only need to provide a Logger option when creating the robot (we can implement the Logger interface you require), and you can provide a default logger implementation at creation. I believe such changes are not very invasive.
The text was updated successfully, but these errors were encountered: