Skip to content

Instantly share code, notes, and snippets.

@kristofk
Created May 29, 2018 09:36
Show Gist options
  • Select an option

  • Save kristofk/e174aaa88e046b6e2e4e20c75d1c5f06 to your computer and use it in GitHub Desktop.

Select an option

Save kristofk/e174aaa88e046b6e2e4e20c75d1c5f06 to your computer and use it in GitHub Desktop.
Prints out the name of the function and the file it is located in! Good to track the flow of the app.
func testPrint(function: String, path: String) {
let pathElements = path.split(separator: "/")
print("TEST: \(function) -> \(pathElements.last!)")
}
// Callsite: testPrint(function: #function, path: #file)
// Filter in the console: test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment