Skip to content

davnag/DJLogger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.