Skip to content

Commit

Permalink
logger module start firstly
Browse files Browse the repository at this point in the history
  • Loading branch information
vcptr committed Oct 31, 2019
1 parent 0eb590c commit 0d60a9e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions infra/conf/v2ray.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,15 @@ func (c *Config) Build() (*core.Config, error) {
config.App = append(config.App, serial.ToTypedMessage(statsConf))
}

var logConfMsg *serial.TypedMessage
if c.LogConfig != nil {
config.App = append(config.App, serial.ToTypedMessage(c.LogConfig.Build()))
logConfMsg = serial.ToTypedMessage(c.LogConfig.Build())
} else {
config.App = append(config.App, serial.ToTypedMessage(DefaultLogConfig()))
logConfMsg = serial.ToTypedMessage(DefaultLogConfig())
}
// let logger module be the first App to start,
// so that other modules could print log during initiating
config.App = append([]*serial.TypedMessage{logConfMsg}, config.App...)

if c.RouterConfig != nil {
routerConfig, err := c.RouterConfig.Build()
Expand Down

0 comments on commit 0d60a9e

Please sign in to comment.