Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
M

Magic

> 编程语言
Open source

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

279 stars0 likes0 views
WebsiteGitHub

About

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

Magic

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

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

The master branch of Magic is compatible with Swift >= v3.1

CocoaPods

ruby
pod 'Magic'

Carthage

swift
github "ArtSabintsev/Magic"

Swift Package Manager

swift
.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():

swift
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

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Ruby

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言