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:
10
client.go
10
client.go
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user