From d3f35f2c5325050e7a1bd18922604cfa1ef31d7d Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Fri, 24 Feb 2023 17:03:38 +0800 Subject: [PATCH] update --- bootstrap/telegram.go | 1 + bootstrap/wechat.go | 1 + main.go | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/bootstrap/telegram.go b/bootstrap/telegram.go index 0d1fc09..794c656 100644 --- a/bootstrap/telegram.go +++ b/bootstrap/telegram.go @@ -13,6 +13,7 @@ import ( ) func StartTelegramBot() { + log.Info("Start Telegram Bot") telegramKey := config.GetTelegram() if telegramKey == nil { log.Info("未找到tg token,不启动tg tot") diff --git a/bootstrap/wechat.go b/bootstrap/wechat.go index 344852b..c14d8d5 100644 --- a/bootstrap/wechat.go +++ b/bootstrap/wechat.go @@ -10,6 +10,7 @@ import ( ) func StartWebChat() { + log.Info("Start WebChat Bot") bot := openwechat.DefaultBot(openwechat.Desktop) bot.MessageHandler = wechat.Handler bot.UUIDCallback = openwechat.PrintlnQrcodeUrl diff --git a/main.go b/main.go index 7b4faf4..751b648 100644 --- a/main.go +++ b/main.go @@ -9,6 +9,12 @@ import ( func main() { log.SetReportCaller(true) + log.SetFormatter(&log.TextFormatter{ + DisableColors: false, + FullTimestamp: true, + }) + + log.Info("程序启动") err := config.LoadConfig() if err != nil { log.Warn("没有找到配置文件,尝试读取环境变量") @@ -21,4 +27,5 @@ func main() { } else if telegramEnv != nil { bootstrap.StartTelegramBot() } + log.Info("程序退出") }