1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-25 00:45:24 +00:00

early inited log

This commit is contained in:
vcptr 2019-11-13 16:31:09 +08:00
parent 901e4837ad
commit 54f903040a

View File

@ -29,6 +29,13 @@ func New(ctx context.Context, config *Config) (*Instance, error) {
}
log.RegisterHandler(g)
// start logger instantly on inited
// other modules would log during init
if err := g.startInternal(); err != nil {
return nil, err
}
newError("Logger started").AtDebug().WriteToLog()
return g, nil
}
@ -81,13 +88,7 @@ func (g *Instance) startInternal() error {
// Start implements common.Runnable.Start().
func (g *Instance) Start() error {
if err := g.startInternal(); err != nil {
return err
}
newError("Logger started").AtDebug().WriteToLog()
return nil
return g.startInternal()
}
// Handle implements log.Handler.