Skip to content

Instantly share code, notes, and snippets.

@Jaid
Last active January 10, 2023 14:49
Show Gist options
  • Select an option

  • Save Jaid/41f660b57989f2b82f53c8a287040b17 to your computer and use it in GitHub Desktop.

Select an option

Save Jaid/41f660b57989f2b82f53c8a287040b17 to your computer and use it in GitHub Desktop.
Debug log with function with line break (which the built-in log function does not do) in AutoHotkey v2
; From https://gist.github.com/Jaid/41f660b57989f2b82f53c8a287040b17
print(message, title := unset) {
if IsSetRef(&title) {
print title ": " message
} else {
; Output for exe files
/*@Ahk2Exe-Keep
FileAppend message "`n", "*"
*/
; Output for ahk files
;@Ahk2Exe-IgnoreBegin
OutputDebug message "`n"
;@Ahk2Exe-IgnoreEnd
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment