https://github.com/e-sites/lithium
_The_ E-sites logging framework
https://github.com/e-sites/lithium
logging swift
Last synced: over 1 year ago
JSON representation
_The_ E-sites logging framework
- Host: GitHub
- URL: https://github.com/e-sites/lithium
- Owner: e-sites
- License: mit
- Created: 2018-07-20T13:37:39.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-12-23T08:58:36.000Z (over 5 years ago)
- Last Synced: 2025-02-15T04:19:21.731Z (over 1 year ago)
- Topics: logging, swift
- Language: Swift
- Size: 63.5 KB
- Stars: 2
- Watchers: 7
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README

Lithium is part of the **[E-sites iOS Suite](https://github.com/e-sites/iOS-Suite)**.
---
_The_ E-sites logging framework.
[](http://forthebadge.com) [](http://forthebadge.com)
[](https://travis-ci.org/e-sites/Lithium)
# Installation
## SwiftPM
**package.swift** dependency:
```swift
.package(url: "https://github.com/e-sites/lithium.git", from: "9.0.0"),
```
and to your application/library target, add `"Lithium"` to your `dependencies`, e.g. like this:
```swift
.target(name: "BestExampleApp", dependencies: ["Lithium"]),
```
# Implementation
## Initialization
```swift
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
}
}
```