Skip to content

Commit

Permalink
✏️ 调整 log 格式
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Sep 27, 2021
1 parent 52a8a9d commit 3623a88
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
5 changes: 0 additions & 5 deletions control/gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
14 changes: 6 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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() {
Expand Down

0 comments on commit 3623a88

Please sign in to comment.