Lithium is part of the E-sites iOS Suite.
The E-sites logging framework.
Podfile:
pod 'Lithium'
And then
pod install
Cartfile:
github "e-sites/Lithium"
And then
carthage update
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
}
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)
You can also automatically log to crashlytics:
Fabric.with([Crashlytics.self])
logger.logProxy = { _, _, message, _ in
CLSLogv("%@", getVaList([ message ]))
}