mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 13:59:39 +08:00
✏️ 调整 log 格式
This commit is contained in:
parent
52a8a9de6f
commit
3623a88b16
@ -61,11 +61,6 @@ func controller() {
|
||||
}
|
||||
}()
|
||||
|
||||
if log.GetLevel() != log.DebugLevel {
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
gin.DefaultWriter = io.Discard
|
||||
}
|
||||
|
||||
engine := gin.New()
|
||||
// 支持跨域
|
||||
engine.Use(cors())
|
||||
|
||||
14
main.go
14
main.go
@ -43,7 +43,7 @@ import (
|
||||
_ "github.com/FloatTech/ZeroBot-Plugin/plugin_setutime" // 来份涩图
|
||||
|
||||
// 以下为内置依赖,勿动
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
zero "github.com/wdvxdr1123/ZeroBot"
|
||||
"github.com/wdvxdr1123/ZeroBot/driver"
|
||||
|
||||
@ -58,19 +58,17 @@ var (
|
||||
"* Project: https://github.com/FloatTech/ZeroBot-Plugin",
|
||||
}
|
||||
banner = strings.Join(contents, "\n")
|
||||
// 是否禁用gui
|
||||
disableGui bool
|
||||
)
|
||||
|
||||
func init() {
|
||||
// 解析命令行参数,输入`-g`即可禁用gui
|
||||
flag.BoolVar(&disableGui, "g", false, "Disable the gui")
|
||||
var en bool
|
||||
// 解析命令行参数,输入 `-g` 即可启用 gui
|
||||
flag.BoolVar(&en, "g", false, "Enable the gui")
|
||||
flag.Parse()
|
||||
if !disableGui {
|
||||
if en {
|
||||
control.InitGui()
|
||||
}
|
||||
|
||||
log.SetLevel(log.DebugLevel)
|
||||
// log.SetLevel(log.DebugLevel)
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user