Skip to content

Instantly share code, notes, and snippets.

@StewartLynch
Created November 6, 2022 22:20
Show Gist options
  • Save StewartLynch/addc916e2006c5ed5773f43ae560ac8f to your computer and use it in GitHub Desktop.
Save StewartLynch/addc916e2006c5ed5773f43ae560ac8f to your computer and use it in GitHub Desktop.
Print file, function and line along with the printed items
public func printDetail( _ items: Any...,
fileID: String = #fileID,
function: String = #function,
line: Int = #line,
separator: String = " ",
terminator: String = "\n") {
print("___________________________")
print(items.map{ "\($0)" }.joined(separator: separator))
print(
"""
๐Ÿ“Œ \(fileID) ๐Ÿ“Œ
function: \(function)
line: \(line)
___________________________
"""
)
}
@hedlynogan
Copy link

hedlynogan commented Nov 7, 2022

I just tried a experiment, I shared your tweet to Mastadon via the iOS share menu; from mastadon without signing on to Twitter authenticated through gibhub, all on my iPad mini. Anyone who sees my toot can then see your gist if they have a GitHub account from mastodon, authenticate, then comment here. I am @[email protected] or maccruzin@twitter

@hedlynogan
Copy link

Nice code I will have to try it.

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