Skip to content

An alternative for Swift's println() function along the lines of DLog.

License

Notifications You must be signed in to change notification settings

benkane/PrintlnMagic

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PrintlnMagic

An alternative for Swift's println() along the lines of DLog

Background

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

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

Changelog (v1.1.1)

  • Updated document comments, including adding the the original println() comments.

Installation

  • CocoaPods
    • pod 'PrintlnMagic'
    • Make sure to call import PrintlnMagic in the files you want to use it. This is a CocoaPods-specific step.
  • Manual
    • Copy the PrintlnMagic.swift file into your project

Usage

You're done immediately after adding PrintlnMagic.swift to your project!

The results of your existing (e.g., boring) println() statements will be overriden in the console with the new format.

Before PrintlnMagic

This is a test string.

After PrintlnMagic

ViewController.viewDidLoad()[15]: This is a test string.
// ViewController is the filename
// viewDidLoad() is the name of the function 
// [15] is the line number

Created and maintainted by

Arthur Ariel Sabintsev

About

An alternative for Swift's println() function along the lines of DLog.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 60.4%
  • Ruby 39.6%