Verbose Print Macro: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
(Created page with 'Category:Logging Functions {{PageAuthor|Zinthose}} == Description == Very simple macro to "[http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.14.3 DetailPrint]" if "VERBOSE...') |
(No difference)
|
Revision as of 21:51, 6 June 2009
| Author: Zinthose (talk, contrib) |
Description
Very simple macro to "DetailPrint" if "VERBOSE" is defined. You could also easily modify this perform debugging if "DEBUG" is defined.
Usage
Example
!define VERBOSE !include VerbosePrint.nsh OutFile VerboseTest.exe ShowInstDetails show Section -Test ${VerbosePrint} 'This message will only print if VERBOSE is defined.' SectionEnd
Macro Source
I wrapped it in an NSH file but you can easily copy and paste it into your scripts.
; ----------------------------- ; VerbosePrint.nsh ; ----------------------------- ; ; Very simple macro to "DetailPrint" if "VERBOSE" is defined. ; ; Useage: /* !define VERBOSE !include VerbosePrint.nsh OutFile VerboseTest.exe ShowInstDetails show Section -Test ${VerbosePrint} 'This message will only print if VERBOSE is defined.' SectionEnd */ !ifndef VerbosePrint !define VerbosePrint "!insertmacro VerbosePrint" !Macro VerbosePrint MESSAGE !ifdef VERBOSE DetailPrint `${MESSAGE}` !endif !macroend !endif ; VerbosePrint