Created
November 6, 2022 22:20
-
-
Save StewartLynch/addc916e2006c5ed5773f43ae560ac8f to your computer and use it in GitHub Desktop.
Print file, function and line along with the printed items
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
___________________________ | |
""" | |
) | |
} |
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
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