SwiftyBeaver-Destinations
Add pre-configured console destinations
Available destinations:
Requirements
- iOS 9
- Xcode 9.2+
- Swift 4
Installation
SwiftyBeaver-Destinations is available through CocoaPods. To install it, simply add the following line to your Podfile with your desired destination:
pod "SwiftyBeaver-Destinations/LogEntries"
pod "SwiftyBeaver-Destinations/Logmatic"
If you just want utils :
pod "SwiftyBeaver-Destinations/Core"
(SwiftyBeaver + Utils)
Example
To run the example project, clone the repo, and run pod install
from the Example
directory first.
Usage
In your AppDelegate class, add let log = SwiftyBeaver.self
Add a destination
Configure SwiftyBeaver by adding your destinations: log.addDestination(<YourDestination>)
Available destinations at the moment are:
LogEntriesDestination(token: String, level: SwiftyBeaver.Level)
Logmatic(apiKey: String, level: SwiftyBeaver.Level)
Utils
LogUtils
file contains methods for logs:
- device details's dictionary (OS version, host name, device name and model):
deviceDetails() -> [String: String]
- thread name if you aren't on the main thread:
threadName() -> String
Destinations
file contains methods for SwiftyBeaver:
SwiftyBeaver's extensions:
- remove a destination:
log.removeDestination(_ dest: BaseDestination.Type)
Default destinations:
- Default console with emojis
🎉 :log.addDestination(Destinations.console)
Contributors
Made in
License
SwiftyBeaver-Destinations is available under the MIT license. See the LICENSE file for more info.