Page 1 of 1

OutputDebug

Posted: 11 Aug 2018, 21:06
by lexikos
Thinking about additional debug functions, such as a function to retrieve details from the call stack, it occurred to me that OutputDebug (which is named after the OutputDebugString function it calls) could be renamed to be more convenient and to start a convention for future debug functions. My current ideas are combinations of Dbg or Debug and Output or Print.

I lean toward Debug rather than Dbg, for clarity, and because after testing it out, "dbg" doesn't seem to be any faster for me (due to use of one finger vs. multiple). There's also auto-complete and hotstrings.

I generally use my own D function which just prints to stdout, anyway.

Re: OutputDebug

Posted: 12 Aug 2018, 05:51
by kczx3
I like Debug for the same reasons as you’ve mentioned

Re: OutputDebug

Posted: 12 Aug 2018, 08:17
by swagfag
autocomplete handles everything, so dont really care what the functions are called.

Re: OutputDebug

Posted: 21 Sep 2018, 07:50
by Helgef
Hello.

I'm quite neutral in the matter of dbgXXX vs debugXXX. Just to note, there is already sort of a convention in naming functions, that is a three letter abbreviation, eg, strXXX, winXXX, maybe others.

In any case, it could be nice to have a positional directive to enable / disable / set options for such functions, eg, #Debug off would ignore all debug functions when parsing the script, example,

Code: Select all

#debug off
#debug stdOut
dbgPrint 'abc'	; Not going to happen
#debug on
dbgPrint 'abc'	; will show in stdout
#debug msgbox
dbgPrint 'abc'	; will show in msgbox
The directive could also apply (on / off) to udfs, named eg, dbg_XXX.

Obviously there will be problems if such functions are used in an expression, eg, #debug off `n if dbgPrint('abc'), I think it is ok though.

Cheers.

Re: OutputDebug

Posted: 30 Sep 2018, 10:52
by egocarib
I would prefer "Debug" over "Dbg".

I also agree with Helgef; I would find a directive or command to disable debug output very useful.