以前,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
}