mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 22:00:11 +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 := gin.New()
|
||||||
// 支持跨域
|
// 支持跨域
|
||||||
engine.Use(cors())
|
engine.Use(cors())
|
||||||
|
|||||||
14
main.go
14
main.go
@ -43,7 +43,7 @@ import (
|
|||||||
_ "github.com/FloatTech/ZeroBot-Plugin/plugin_setutime" // 来份涩图
|
_ "github.com/FloatTech/ZeroBot-Plugin/plugin_setutime" // 来份涩图
|
||||||
|
|
||||||
// 以下为内置依赖,勿动
|
// 以下为内置依赖,勿动
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
zero "github.com/wdvxdr1123/ZeroBot"
|
zero "github.com/wdvxdr1123/ZeroBot"
|
||||||
"github.com/wdvxdr1123/ZeroBot/driver"
|
"github.com/wdvxdr1123/ZeroBot/driver"
|
||||||
|
|
||||||
@ -58,19 +58,17 @@ var (
|
|||||||
"* Project: https://github.com/FloatTech/ZeroBot-Plugin",
|
"* Project: https://github.com/FloatTech/ZeroBot-Plugin",
|
||||||
}
|
}
|
||||||
banner = strings.Join(contents, "\n")
|
banner = strings.Join(contents, "\n")
|
||||||
// 是否禁用gui
|
|
||||||
disableGui bool
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
// 解析命令行参数,输入`-g`即可禁用gui
|
var en bool
|
||||||
flag.BoolVar(&disableGui, "g", false, "Disable the gui")
|
// 解析命令行参数,输入 `-g` 即可启用 gui
|
||||||
|
flag.BoolVar(&en, "g", false, "Enable the gui")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
if !disableGui {
|
if en {
|
||||||
control.InitGui()
|
control.InitGui()
|
||||||
}
|
}
|
||||||
|
// log.SetLevel(log.DebugLevel)
|
||||||
log.SetLevel(log.DebugLevel)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user