Lithium

7.1.2

_The_ E-sites logging framework
e-sites/Lithium

What's New

v7.1.2

2020-12-23T08:58:36Z

Lithium

Lithium is part of the E-sites iOS Suite.


The E-sites logging framework.

forthebadge forthebadge

Platform CocoaPods Compatible Travis-ci Carthage compatible

Installation

CocoaPods

Podfile:

pod 'Lithium'

And then

pod install

Carthage

Cartfile:

github "e-sites/Lithium"

And then

carthage update

Implementation

Initialization

import Lithium
let logger = Lithium.Logger()

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication,
                     didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    logger.theme = EmojiLogTheme()
    // logger.theme = NoColorsLogTheme() // If you don't have the XcodeColors plugin installed
    #if !DEBUG
    logger.enabled = false
    #endif
    
    // ... The rest of the launch stuff
    
    return true
}

Logging

public func error(_ items:Any...)
public func warning(_ items:Any...,)    
public func exe(_ items:Any...)    
public func debug(_ items:Any...)    
public func info(_ items:Any...)    
public func success(_ items:Any...)    
public func verbose(_ items:Any...)
public func log(_ items:Any...)    
public func colorLog(_ foregroundColor: String, backgroundColor:String?=nil, _ items:Any...)
public func request(_ method: String, _ url:String, _ parameters:String?=nil)
public func response(_ method: String, _ url:String, _ parameters:String?=nil)

public func table<O>(object:O, shouldPrint:Bool=true)
public func table<O>(object: O, shouldPrint:Bool=true)
public func table<V>(array: [V], shouldPrint:Bool=true)
public func table<V>(dictionary: [String: V], title: String, shouldPrint: Bool)

Crashlytics

You can also automatically log to crashlytics:

Fabric.with([Crashlytics.self])

logger.logProxy = { _, _, message, _ in
    CLSLogv("%@", getVaList([ message ]))
}

Description

  • Swift Tools 5.1.0
View More Packages from this Author

Dependencies

Last updated: Mon Oct 21 2024 15:02:11 GMT-0900 (Hawaii-Aleutian Daylight Time)