A Swift alternative for Objective-C's DLog macro.
Ruby Swift Objective-C
Latest commit 7c5a918 Jun 7, 2017 @ArtSabintsev Updated README
Permalink
Failed to load latest commit information.
MagicExample
Sources Minor changes to documentation. May 11, 2017
.gitignore Initial commit Jan 28, 2015
.swift-version Added Gemfile and .swift-verison file Sep 14, 2016
Gemfile Fixed Swift PM Support. Mar 4, 2017
Gemfile.lock
LICENSE Initial commit Jan 28, 2015
Magic.podspec Minor changes to documentation. May 11, 2017
Package.swift Added Swift PM support Feb 8, 2016
README.md

README.md

Magic

A Swift alternative for Objective-C's DLog macro.

CocoaPods Carthage Compatible SwiftPM Compatible CocoaPods CocoaPods

Background

If you're like me, you miss seeing the filename, method name, and/or line number in your print statements in your Swift projects.

Fear not, Magic is here to bring you back to the good old days of DLog.

This extension was previously known as PrintlnMagic.

Installation

CocoaPods

For Swift 3 support:

pod 'Magic'

For Swift 4 support:

pod 'Magic', :git => 'https://github.com/ArtSabintsev/Magic.git', :branch => 'swift4'

Carthage

For Swift 3 support:

github "ArtSabintsev/Magic"

For Swift 4 support:

github "ArtSabintsev/Magic", "swift4"

Swift Package Manager

.Package(url: "https://github.com/ArtSabintsev/Magic.git", majorVersion: 3)

Setup

Replace all the print() statements in your project with magic().

Example

Before Magic, your console will display the following from print():


This is a test string.

After Magic, your console will display the following from magic():

ViewController.viewDidLoad()[17]: This is a test string.

// Where:
//     ViewController is the filename
//     viewDidLoad() is the name of the function
//     [17] is the line number

Created and maintainted by

Arthur Ariel Sabintsev