mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-04 04:30:08 +00:00
change log to logrus
This commit is contained in:
@@ -2,7 +2,7 @@ package node
|
||||
|
||||
import (
|
||||
"github.com/Yuzuki616/V2bX/api/panel"
|
||||
"log"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"runtime"
|
||||
"strconv"
|
||||
)
|
||||
@@ -25,9 +25,12 @@ func (c *Controller) reportUserTrafficTask() (err error) {
|
||||
if len(userTraffic) > 0 {
|
||||
err = c.apiClient.ReportUserTraffic(userTraffic)
|
||||
if err != nil {
|
||||
log.Printf("Report user traffic faild: %s", err)
|
||||
log.WithFields(log.Fields{
|
||||
"tag": c.Tag,
|
||||
"err": err,
|
||||
}).Error("Report user traffic faild")
|
||||
} else {
|
||||
log.Printf("[%s] Report %d online users", c.Tag, len(userTraffic))
|
||||
log.WithField("tag", err).Errorf("Report %d online users", len(userTraffic))
|
||||
}
|
||||
}
|
||||
userTraffic = nil
|
||||
|
||||
Reference in New Issue
Block a user