1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-18 09:57:04 -04:00
v2fly/common/log/config.go
2016-10-03 22:07:28 +02:00

26 lines
471 B
Go

package log
func (this *Config) Apply() error {
if this == nil {
return nil
}
if this.AccessLogType == LogType_File {
if err := InitAccessLogger(this.AccessLogPath); err != nil {
return err
}
}
if this.ErrorLogType == LogType_None {
SetLogLevel(LogLevel_Disabled)
} else {
if this.ErrorLogType == LogType_File {
if err := InitErrorLogger(this.ErrorLogPath); err != nil {
return err
}
}
SetLogLevel(this.ErrorLogLevel)
}
return nil
}