1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-03 14:40:42 +00:00

isolate log settings synthesis

This commit is contained in:
Shelikhoo 2021-06-19 13:30:46 +01:00
parent 72d2184dba
commit 3510ddb464
No known key found for this signature in database
GPG Key ID: C4D5E79D22B25316
2 changed files with 4 additions and 3 deletions

View File

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

View File

@ -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