Skip to content

Instantly share code, notes, and snippets.

@jessesquires
Last active April 19, 2016 20:20
Show Gist options
  • Save jessesquires/c012078a90d04c9f83eb to your computer and use it in GitHub Desktop.
Save jessesquires/c012078a90d04c9f83eb to your computer and use it in GitHub Desktop.
PrettyPrint
public func print<T>(object: T, _ file: String = __FILE__, _ function: String = __FUNCTION__, _ line: Int = __LINE__) {
Swift.print("\(file.lastPathComponent.stringByDeletingPathExtension).\(function)[\(line)]: \(object)")
}
@jessesquires
Copy link
Author

final class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

        // prints "AppDelegate.application(_:didFinishLaunchingWithOptions:)[10]: Testing"
        print("Testing")

        return true
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment