1
0
mirror of https://github.com/fumiama/ReiBot.git synced 2026-06-05 00:50:25 +08:00

change logger to logrus

This commit is contained in:
源文雨
2022-06-02 15:26:54 +08:00
parent 82b09a664a
commit e2b9c60ffb
3 changed files with 24 additions and 4 deletions

View File

@@ -3,10 +3,12 @@ package rei
import (
"log"
"reflect"
"sync"
"time"
"unsafe"
tgba "github.com/go-telegram-bot-api/telegram-bot-api/v5"
"github.com/sirupsen/logrus"
)
// TelegramClient ...
@@ -15,6 +17,14 @@ type TelegramClient struct {
b Bot
}
var logsetter = &sync.Once{}
func init() {
logsetter.Do(func() {
tgba.SetLogger(logrus.StandardLogger())
})
}
// NewTelegramClient ...
func NewTelegramClient(c *Bot) (tc TelegramClient) {
tc.b = *c