mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 18:17:52 -05:00
26 lines
471 B
Go
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
|
|
}
|