Swiftpack.co - Package - infinitetoken/Lumber-Swift

Lumber

Cloud logging for Swift

Installation

Lumber can be installed using the Swift Package Manager. Add the following to your Package.swift file:


dependencies: [
    .Package(url: "https://github.com/infinitetoken/Lumber-Swift.git", from: "2.0.0")
]

Usage

Initialize Lumber (optionally passing an API key obtained from Lumber app; See below):

import Lumber

let apiKey = ... // My API key
let lumber = Lumber(apiKey: apiKey)

To log a message to the console at any time:


lumber.log("A Message", level: .error) // 2018-05-01 06:51:08 +0000 [‼️][MyFile.swift]:22 19 myFunction() -> A Message
lumber.log("A Message", level: .info) // 2018-05-01 06:51:08 +0000 [ℹ️][MyFile.swift]:22 19 myFunction() -> A Message
lumber.log("A Message", level: .debug) // 2018-05-01 06:51:08 +0000 [💬][MyFile.swift]:22 19 myFunction() -> A Message
lumber.log("A Message", level: .verbose) // 2018-05-01 06:51:08 +0000 [🔬][MyFile.swift]:22 19 myFunction() -> A Message
lumber.log("A Message", level: .warning) // 2018-05-01 06:51:08 +0000 [⚠️][MyFile.swift]:22 19 myFunction() -> A Message
lumber.log("A Message", level: .critical) // 2018-05-01 06:51:08 +0000 [🔥][MyFile.swift]:22 19 myFunction() -> A Message

To log an error:


enum TestError: LocalizedError {
    case error
    
    var errorDescription: String? {
        switch self {
        case .error:
            return "Test Error"
        }
    }
}

lumber.error(TestError.error) // 2018-05-01 06:51:08 +0000 [‼️][MyFile.swift]:22 19 myFunction() -> Test Error

That's it! Swing the lumber...

App

Lumber has a companion app available for MacOS, Windows, and LInux for viewing messages and errors logged to the cloud by using an optional API key. An API key can be obtained by creating a new app instance in the Lumber app.

Lumber Screenshot

Download the Lumber app

License

Lumber is released under the MIT license. See LICENSE for details.

Github

link
Stars: 1
Help us keep the lights on

Dependencies

Used By

Total: 0

Releases

v2.6.2 - Nov 21, 2019

Update README and tests

v1.1.1 - Nov 20, 2019

Update

v2.6.1 - Nov 8, 2019

Fix

v2.6.0 - Nov 8, 2019

Change method signatures

v2.5.0 - Oct 29, 2019

Merge