_The_ E-sites 日志框架
Lithium 是 E-sites iOS Suite 的一部分。
E-sites 日志记录框架。
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
}
}