Skip to content

Instantly share code, notes, and snippets.

@deya-eldeen
Last active January 25, 2022 08:09
Show Gist options
  • Save deya-eldeen/5bd2f442493f1a14a19256de8f736ef0 to your computer and use it in GitHub Desktop.
Save deya-eldeen/5bd2f442493f1a14a19256de8f736ef0 to your computer and use it in GitHub Desktop.
import Foundation
public func print(_ items: Any..., separator: String = " ", terminator: String = "\n") {
#if DEBUG
let output = items.map { "\n⚠️ YourAppName \($0)" }.joined(separator: separator)
Swift.print(output, terminator: terminator)
#else
if(Environment.allowPrint == "1"){
let output = items.map { "\n⚠️ YourAppName \($0)" }.joined(separator: separator)
Swift.print(output, terminator: terminator)
}
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment