以前,XCGLogger对我来说工作正常,但我决定尝试一些更高级的功能。现在,在Xcode的控制台视图我的日志输出填充:“XCGLogger写入日志”在每个记录行前重复
XCGLogger writing log to: <my logfile name>
它出现的每个记录消息之前。任何想法为什么?
我对XCGLogger设置:
var log : XCGLogger {
let log = XCGLogger(identifier: "advancedLogger", includeDefaultDestinations: false)
let fileDestination = FileDestination(writeToFile: Constants.file.debugging, identifier: "advancedLogger.fileDestination")
fileDestination.showLogIdentifier = false
fileDestination.showFunctionName = true
fileDestination.showThreadName = false
fileDestination.showLevel = false
fileDestination.showFileName = true
fileDestination.showLineNumber = true
fileDestination.showDate = true
#if DEBUG
fileDestination.outputLevel = .verbose
#else
fileDestination.outputLevel = .debug
// don't log on main thread in production
fileDestination.logQueue = XCGLogger.logQueue
#endif
// Add the destination to the logger
log.add(destination: fileDestination)
return log
}