Просмотр исходного кода

isolate log settings synthesis

Shelikhoo 4 лет назад
Родитель
Сommit
3510ddb464
2 измененных файлов с 4 добавлено и 3 удалено
  1. 1 1
      infra/conf/synthetic/log/log.go
  2. 3 2
      infra/conf/v2ray.go

+ 1 - 1
infra/conf/log.go → infra/conf/synthetic/log/log.go

@@ -1,4 +1,4 @@
-package conf
+package log
 
 import (
 	"strings"

+ 3 - 2
infra/conf/v2ray.go

@@ -3,6 +3,7 @@ package conf
 import (
 	"encoding/json"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/loader"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/log"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/router"
 	"strings"
 
@@ -340,7 +341,7 @@ type Config struct {
 	// and should not be used.
 	OutboundDetours []OutboundDetourConfig `json:"outboundDetour"`
 
-	LogConfig        *LogConfig              `json:"log"`
+	LogConfig        *log.LogConfig          `json:"log"`
 	RouterConfig     *router.RouterConfig    `json:"routing"`
 	DNSConfig        *DNSConfig              `json:"dns"`
 	InboundConfigs   []InboundDetourConfig   `json:"inbounds"`
@@ -433,7 +434,7 @@ func (c *Config) Build() (*core.Config, error) {
 	if c.LogConfig != nil {
 		logConfMsg = serial.ToTypedMessage(c.LogConfig.Build())
 	} else {
-		logConfMsg = serial.ToTypedMessage(DefaultLogConfig())
+		logConfMsg = serial.ToTypedMessage(log.DefaultLogConfig())
 	}
 	// let logger module be the first App to start,
 	// so that other modules could print log during initiating