Skip to content

shawnynicole/PrintMate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PrintMate

CI Status Version License Platform

Example

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

try pod 'PrintMate'

Requirements

Swift 5

Installation

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

pod 'PrintMate'

Usage

import UIKit
import PrintMate

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        // Common usage
        
        verbose("Hello World!")
        
        // Custom title 
        // A separator with a custom title is drawn around the text in the console.
        
        verbose(type: .title("Custom"), "Hello World!")
        
        // Static 
        
        MyStruct.sayHello()
        
        // MyStruct conforms to Verbose
        
        MyStruct().sayHello()
        
        // Handling errors
        // A separator is drawn around the error in the console so that errors stand out.
        
        do {
            try getError()
        } catch {
            verbose(error)
        }
        
        // Superclass
        
        AClass().sayHello()
        
        // Subclass
        // Subclass calls super. Notice PrintMate.AClass.swift 15 and PrintMate.BClass.swift 16 is printed to the console.
        
        BClass().sayHello()
    }
    
    func getError() throws {
        throw MyError("This is my error message.")
    }
}
[2019-11-18 03:29:08 PM PrintMate.ViewController.swift ViewController.viewDidLoad() 19] Hello World!

************************************************************** CUSTOM **************************************************************
[2019-11-18 03:29:08 PM PrintMate.ViewController.swift ViewController.viewDidLoad() 24] Hello World!
***********************************************************************************************************************************

[2019-11-18 03:29:08 PM PrintMate.MyStruct.swift MyStruct.sayHello() 15] Hello World!

[2019-11-18 03:29:08 PM PrintMate.MyStruct.swift MyStruct.sayHello() 19] Hello World!

************************************************************** ERROR **************************************************************
[2019-11-18 03:29:08 PM PrintMate.ViewController.swift ViewController.viewDidLoad() 40] MyError(message: "This is my error message.")
***********************************************************************************************************************************

[2019-11-18 03:29:08 PM PrintMate.AClass.swift AClass.sayHello() 15] Hello AClass!

[2019-11-18 03:29:08 PM PrintMate.AClass.swift BClass.sayHello() 15] Hello AClass!

[2019-11-18 03:29:08 PM PrintMate.BClass.swift BClass.sayHello() 16] Hello BClass!

Author

shawnynicole

License

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

About

Swiftly debug using PrintMate. PrintMate prints valuable information to the console to assist with swift debugging.

Resources

License

Stars

Watchers

Forks

Packages

No packages published