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("程序退出") }