锂元素是 E-sites iOS Suite 的一部分。
该 E-sites 日志框架。
安装
SwiftPM
package.swift 依赖关系
.package(url: "https://github.com/e-sites/lithium.git", from: "9.0.0"),
然后在您的应用程序/库目标中,将 "Lithium"
添加到您的 dependencies
中,例如:
.target(name: "BestExampleApp", dependencies: ["Lithium"]),
实现
初始化
import Lithium
let logger: Logger = {
var ll = Logger(label: "com.swift-log.awesome-app")
ll.logLevel = .trace
return ll
}()
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
LoggingSystem.bootstrap { label -> LogHandler in
var lithiumLogger = LithiumLogger(label: label)
lithiumLogger.theme = EmojiLogTheme()
return lithiumLogger
}
return true
}
}