Skip to content

smartnsoft/SwiftyBeaver-Destinations

Repository files navigation

SwiftyBeaver-Destinations

CI Status Version License Platform

Add pre-configured console destinations 🔌 for, and based on SwiftyBeaver.

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 🇫🇷 by the Smart&Soft iOS Team.

License

SwiftyBeaver-Destinations is available under the MIT license. See the LICENSE file for more info.