From 848c7b014a3c3055534e4884a551c26e87412144 Mon Sep 17 00:00:00 2001 From: yuzuki999 Date: Thu, 13 Jul 2023 01:19:13 +0800 Subject: [PATCH] fix bugs --- common/builder/user.go | 2 +- conf/core.go | 2 +- conf/log.go | 2 +- node/task.go | 6 ++++-- node/user.go | 4 ++-- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/common/builder/user.go b/common/builder/user.go index bde1c86..91a5399 100644 --- a/common/builder/user.go +++ b/common/builder/user.go @@ -105,7 +105,7 @@ func BuildSSUser(tag string, userInfo *panel.UserInfo, cypher string, serverKey } return &protocol.User{ Level: 0, - Email: tag, + Email: BuildUserTag(tag, userInfo.Uuid), Account: serial.ToTypedMessage(ssAccount), } } diff --git a/conf/core.go b/conf/core.go index ce4fc08..45b8ce2 100644 --- a/conf/core.go +++ b/conf/core.go @@ -2,7 +2,7 @@ package conf type CoreConfig struct { Type string `yaml:"Type"` - XrayConfig *XrayConfig `yaml:"Xray"` + XrayConfig *XrayConfig `yaml:"XrayConfig"` } type XrayConfig struct { diff --git a/conf/log.go b/conf/log.go index 4380c21..86bb6d1 100644 --- a/conf/log.go +++ b/conf/log.go @@ -8,7 +8,7 @@ type LogConfig struct { func NewLogConfig() *LogConfig { return &LogConfig{ - Level: "none", + Level: "warning", AccessPath: "", ErrorPath: "", } diff --git a/node/task.go b/node/task.go index d87b380..550f11d 100644 --- a/node/task.go +++ b/node/task.go @@ -177,7 +177,9 @@ func (c *Controller) nodeInfoMonitor() (err error) { } } c.userList = newUserInfo - log.WithField("tag", c.Tag). - Errorf("%d user deleted, %d user added", len(deleted), len(added)) + if len(added)+len(deleted) != 0 { + log.WithField("tag", c.Tag). + Infof("%d user deleted, %d user added", len(deleted), len(added)) + } return nil } diff --git a/node/user.go b/node/user.go index b8e95cc..91aa5df 100644 --- a/node/user.go +++ b/node/user.go @@ -28,9 +28,9 @@ func (c *Controller) reportUserTrafficTask() (err error) { log.WithFields(log.Fields{ "tag": c.Tag, "err": err, - }).Error("Report user traffic faild") + }).Info("Report user traffic failed") } else { - log.WithField("tag", err).Errorf("Report %d online users", len(userTraffic)) + log.WithField("tag", c.Tag).Infof("Report %d online users", len(userTraffic)) } } userTraffic = nil