davnag / DJLogger

Simple file logger with optional UI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DJLogger

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

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

pod 'DJLogger'

Implementation

import DJLogger

class ViewController: UIViewController {

    let logger = DJLLogger("My Log", [DJLConsoleHandler(), DJLFileHandler("logfile")])

    override func viewDidLoad() {
        super.viewDidLoad()
        logger.trace("View Did Load")
    }
    
    func requestData() {
    
        logger.debug("Start Requesting Data")
        
        // ...
        
        logger.debug("Data Request Completed")
        
        // or
        
        logger.error("Data Request Failed")
    }

}

Author

David Jonsén

License

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

About

Simple file logger with optional UI

License:MIT License


Languages

Language:Swift 97.3%Language:Ruby 2.7%