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
.
- Updated document comments, including adding the the original
println()
comments.
- 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
- Copy the
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