Talk:Logging:Enable Logs Quickly

From NSIS Wiki
Jump to navigationJump to search

If you try to include something more complex into ${INPUT_TEXT}, like:

LogText "$\r$\n*** New logging started - ${DATE} ***"

You will get compile error:

!insertmacro: LogTextMacro
LogText expects 1 parameters, got 12.

simple fix - add quotes "${INPUT_TEXT}" in:

!define LogText "!insertmacro LogTextMacro"
!macro LogTextMacro INPUT_TEXT
  !ifdef ENABLE_LOGGING
    LogText "${INPUT_TEXT}"
  !endif
!macroend