试图建立XCGLogger和接收错误:XCGLogger:不明确的参考成员“登陆”
Ambiguous reference to member 'log'
我看到这个问题已经raised但我不是在溶液变透明..
在单独源文件
@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
}
然后:
0每安装指南加入这个全局变量到AppDelegate.swiftimport XCGLogger
log.debug("A debug message")
什么是正确的用法?
凡在AppDelegate中没有你把代码?它是在AppDelegate类还是全局? – ryantxr
'nameOfYourProject.log.debug'?但可能将'log'重命名为其他内容会更好。你能找到碰撞标识符“log”吗? – Sulthan
@ryantxr:更新的问题 –