Optimize: log in background queue

This commit is contained in:
yicheng 2018-11-30 22:16:10 +08:00
parent 02582da547
commit e82efda6d6
1 changed files with 3 additions and 1 deletions

View File

@ -36,7 +36,9 @@ class Logger {
}
static func log(msg:String ,level:ClashLogLevel = .unknow) {
shared.logToFile(msg: "[\(level.rawValue)] \(msg)", level: level)
DispatchQueue.global().async {
shared.logToFile(msg: "[\(level.rawValue)] \(msg)", level: level)
}
}
func logFilePath() -> String {