Skip to content

ElonPark/EPLogger

Folders and files

NameName
Last commit message
Last commit date
Mar 14, 2022
Apr 25, 2022
Nov 14, 2021
Apr 25, 2022
Mar 21, 2020
Mar 21, 2020
Mar 12, 2022
Mar 28, 2020
Nov 14, 2021
Aug 29, 2019
Mar 21, 2020

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, sungwoon.park92@gmail.com

License

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