Dominique Vial
Dominique Vial

Reputation: 3969

Display time in Xcode breakpoint

In Xcode 6 I have created a breakpoint that do not interrupt the program execution to display informations.

enter image description here

Here is the result between results of NSLog calls:

enter image description here

I now want to add a time information to this message as done by NSLog does. How can I achieve this?

Similar behavior

I know how to obtain such a result using Debugger Command but I want to know how to achieve it using Log Message:

enter image description here

Upvotes: 4

Views: 1928

Answers (2)

yoAlex5
yoAlex5

Reputation: 34311

Xcode log time

Using Swift you are able to use @Date().debugDescription@ my message (UTC time)

Upvotes: 4

Marek Manduch
Marek Manduch

Reputation: 2491

As you can see in the hints: @exp@

so you can write this:

@[NSDate date]@ - some additional message

Output will be:

2018-06-28 14:06:45 UTC - some additional message

(works only for the 'Log Message' type)

Upvotes: 6

Related Questions