telebot
telebot copied to clipboard
What's the best way to implement Winston logger as a Telebot's middleware ?
I was wondering if someone has already used Winston as a Telebot's logger middleware, because I'm not sure of the best way to do it: as a plugin, modifier, or just listen to every bot's events.
Any comments, opinions and remark on this matter would be much appreciated, thanks !
You may listen the bot event, then write it on your logger.
// for any command
bot.on('/*', msg => {
// run logger here
})
// for any incoming text
bot.on('text', msg => {
// run logger here
})
PS: i'm not using logger for my own project, better to forward the log into my own telegram account for quick action and response :yum: IMHO