Noob in Swift
Noob in Swift

Reputation: 113

Xcode: How to print colored PRINT statement in console output?

I am new to Swift and I was wondering if it is possible to print colored print statement in the console of Xcode..

Here's an example:

print("Hi my name is John Doe")

now I want to print this statement in red color, how would I do that?

Upvotes: 0

Views: 4019

Answers (1)

Christian Abella
Christian Abella

Reputation: 5797

That feature has been killed by Apple from Xcode 8. But you can use SwiftyBeaver to achieve it.

let log = SwiftyBeaver.self
let console = ConsoleDestination()
log.addDestination(console)

// default xcode colors
console.levelColor.verbose = "💜 "

Upvotes: 4

Related Questions