Retired Document
Important: This document may not represent best practices for current development. Links to downloads and other resources may no longer be valid.
Using Breakpoint Actions for Logging
Q: How do I use Breakpoint Actions for logging debug messages?
A: Traditionally, many programmers have used printf, NSLog, and similar facilities for tracing execution through in code. Similar functionality can be achieved using Breakpoint Actions, which allow you to attach a set of log expressions to a standard debugging breakpoint.
The steps for logging via a Breakpoint Action are:
Set a breakpoint by clicking once in the editor window's "gutter".
Control-click (or right-click) to display the breakpoint context menu, and choose "Edit Breakpoint". This will open the breakpoints window.
Click the "+" button to open the breakpoint actions.
Enter your log text.
Click the top right checkbox to ensure that execution continues when the breakpoint is hit.
Document Revision History
Date | Notes |
---|---|
2015-03-09 | Moved to Retired Documents Library. |
2009-12-09 | First Version |
Copyright © 2015 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2015-03-09