尝试设置 XCGLogger 并收到错误:
对成员“日志”的模糊引用
我看到这个问题已经提出,但我不清楚解决方案..
根据安装指南,将此全局常量添加到 AppDelegate.swift:
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
let log = XCGLogger.defaultInstance()
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
log.setup(.Debug, showThreadName: true, showLogLevel: true, showFileNames: true, showLineNumbers: true, writeToFile: nil, fileLogLevel: .Debug)
return true
}
然后在单个源文件中:
import XCGLogger
log.debug("A debug message")
正确的用法是什么?