TLLogging
安装
从 CocoaPods 安装
CocoaPods 是 Objective-C 和 Swift 的依赖管理工具,它自动化并简化了在项目中使用第三方库(如 TLLogging
)的过程。首先,将以下行添加到您的 Podfile
pod 'TLLogging'
注册日志引擎
将以下行添加到您的 AppDelegate 中的 didFinishLaunchingWithOptions
函数以注册日志引擎。(见示例 Xcode 项目)
TLLogging.addLogEngine(TLConsoleLogEngine())
TLLogging.addLogEngine(TLCrashlyticsLogEngine())
用法
TLLogging.log("Application start with options %@", launchOptions ?? [:])
调试检查
调试检查是一个有用的功能,可以在变量值不符合预期时捕获您的调试器
DCHECK(<#conditional#>)
许可协议
TLLogging
遵照MIT许可的条款和条件分发。