Apologies for posting on old thread but I have a new comment to make . I have exactly the same issue as technight, lots of log statements I don't want in the production version.
I stopped the log being created by using calling this sub 'Blog' instead of log.
Response : That's the mistake, don't put the log in a sub.
Sub Blog(msg as string)
#if debug
Log(msg)
#end if
End sub
This is all very well, but the code of the calls to the sub is still generated and all the strings etc are in the compiled code. As I understand it, these strings are not obfuscated, which is not ideal then.
What would be useful then is a contracted one line form of the #if x ... #end if construct.
Indeed that's possible if you use :
#If DEBUG
Log("Anything: " & WhatYouWant)
#End If
Eg
#debug log(xyz)
Then you could do a global replace on all the log statements!
Derek