import EPLogger
in yourAppDelegate.swift
- copy & paste
public typealias Log = EPLogger.Log
into yourAppDelegate.swift
to top - Set Log level in to
AppDelegate.didFinishLaunchingWithOptions
method - Done!
more detail, see 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
Swift 5.0
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"
Elon Park, [email protected]
EPLogger is available under the MIT license. See the LICENSE file for more info.