mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-03-13 22:53:10 +00:00
improved - message logs
This commit is contained in:
@@ -183,6 +183,7 @@ func (x *XrayAPI) GetTraffic(reset bool) ([]*Traffic, []*ClientTraffic, error) {
|
||||
|
||||
resp, err := (*x.StatsServiceClient).QueryStats(ctx, &statsService.QueryStatsRequest{Reset_: reset})
|
||||
if err != nil {
|
||||
logger.Debug("Failed to query Xray stats:", err)
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
@@ -196,7 +197,6 @@ func (x *XrayAPI) GetTraffic(reset bool) ([]*Traffic, []*ClientTraffic, error) {
|
||||
processClientTraffic(matches, stat.Value, emailTrafficMap)
|
||||
}
|
||||
}
|
||||
|
||||
return mapToSlice(tagTrafficMap), mapToSlice(emailTrafficMap), nil
|
||||
}
|
||||
|
||||
|
||||
@@ -60,14 +60,14 @@ func GetAccessPersistentPrevLogPath() string {
|
||||
func GetAccessLogPath() (string, error) {
|
||||
config, err := os.ReadFile(GetConfigPath())
|
||||
if err != nil {
|
||||
logger.Warningf("Something went wrong: %s", err)
|
||||
logger.Warningf("Failed to read configuration file: %s", err)
|
||||
return "", err
|
||||
}
|
||||
|
||||
jsonConfig := map[string]interface{}{}
|
||||
err = json.Unmarshal([]byte(config), &jsonConfig)
|
||||
if err != nil {
|
||||
logger.Warningf("Something went wrong: %s", err)
|
||||
logger.Warningf("Failed to parse JSON configuration: %s", err)
|
||||
return "", err
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ func (p *process) Start() (err error) {
|
||||
|
||||
err = os.MkdirAll(config.GetLogFolder(), 0o770)
|
||||
if err != nil {
|
||||
logger.Warningf("Something went wrong: %s", err)
|
||||
logger.Warningf("Failed to create log folder: %s", err)
|
||||
}
|
||||
|
||||
configPath := GetConfigPath()
|
||||
@@ -224,7 +224,7 @@ func (p *process) Start() (err error) {
|
||||
go func() {
|
||||
err := cmd.Run()
|
||||
if err != nil {
|
||||
logger.Error("Failure in running xray-core: ", err)
|
||||
logger.Error("Failure in running xray-core:", err)
|
||||
p.exitErr = err
|
||||
}
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user