Skip to content

ElonPark/EPLogger

Repository files navigation

EPLogger

Version License Platform

Use

  1. import EPLogger in your AppDelegate.swift
  2. copy & paste public typealias Log = EPLogger.Log into your AppDelegate.swift to top
  3. Set Log level in to AppDelegate.didFinishLaunchingWithOptions method
  4. Done!

more detail, see Example

Example

import UIKit
import EPLogger

// If you want to get import once and use it globally
public typealias Log = EPLogger.Log

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        
        // Set log level. default is verbose
        Log.config(level: .verbose)
        Log.verbose("This is verbose")
        Log.debug("This is debug")
        Log.info("This is info")
        Log.warning("This is warning")
        Log.error("This is error")

        return true
    )
}

It will print like this

Requirements

Swift 5.0

Installation

EPLogger is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'EPLogger'

Also, Support Carthage too
simply add the following line to your Cartfile:

github "ElonPark/EPLogger"

Author

Elon Park, [email protected]

License

EPLogger is available under the MIT license. See the LICENSE file for more info.