Adobe 65007312 Programming Guide - Page 183
Debugging your plug-in, Specifying a log
UPC - 883919154398
View all Adobe 65007312 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 183 highlights
CHAPTER 9: Getting Started: A Tutorial Example Debugging your plug-in 183 7. Click Update again, without changing the text in the "New value" field. Notice how the text turns black. This is because the observer is only notified when the bound value changes. 8. Dismiss the dialog with OK or Cancel. Debugging your plug-in The Lightroom SDK does not supply a development environment for you to debug your plug-ins. You can write your plug-ins using any text editor, and write debugging output using the LrLogger namespace. The SDK does not provide a facility to view the debugging output directly; you can write out a log file to disk, or use a third-party application, such as one of these tools: X WinDbg - available for download from http://www.microsoft.com/whdc/DevTools/Debugging/default.mspx X Microsoft Developer Studio X Console - built-in application on Mac OS, look in /Applications/Utilities X Xcode Specifying a log Use these steps to add trace information to the Hello World plug-in: 1. Edit the LibraryMenuItem.lua file to import the LrLogger namespace: local LrLogger = import 'LrLogger' 2. After the import statements, create a new logger instance named libraryLogger and enable the print or logfile action: local myLogger = LrLogger( 'libraryLogger' ) myLogger:enable( "print" ) -- or "logfile" Z Choose print if using a console log viewing tool; see "Viewing trace information in a platform console" on page 184. Z Choose logfile if using a text file for debugging; see "Viewing trace information using log files" on page 184 3. Create a function named MyHWLibraryItem.outputToLog() that accepts a single string argument. In the body of the function, send the accepted argument to the LrLogger:trace() function: function MyHWLibraryItem.outputToLog( message ) myLogger:trace( message ) end 4. Add trace information to the myCalledFunction function. Add the following code: MyHWLibraryItem.outputToLog( "props.myObservedString has been updated." ) 5. Within the action function for the Update button, add the following trace information: MyHWLibraryItem.outputToLog( "Update button clicked." )