feat: 独立debug选项,改善日志文件输出

This commit is contained in:
Mmx233
2022-03-01 23:11:17 +08:00
parent ccd1472f6f
commit 7867a99f3b
5 changed files with 33 additions and 27 deletions

View File

@@ -10,7 +10,8 @@ import (
)
func Login(c *srunTransfer.Login) error {
util.Log.Demo = c.Demo
util.Log.Debug = c.Debug
util.Log.WriteFile = c.WriteLog
util.Log.OutPut = c.OutPut
G := util.GenerateLoginInfo(c.LoginInfo.Form, c.LoginInfo.Meta)
@@ -101,7 +102,7 @@ func Login(c *srunTransfer.Login) error {
return e
} else {
util.Log.Println("登录结果: " + G.LoginResult)
if c.Demo {
if c.Debug {
util.Log.Println(res)
}
}

View File

@@ -22,8 +22,10 @@ type LoginInfo struct {
}
type Login struct {
//文件日志输出开关
Demo bool
//Debug模式
Debug bool
//输出日志文件
WriteLog bool
//控制台日志打印开关
OutPut bool
//登陆前是否检查网络,只在离线时登录