Instead of, but similar to, the printon setting, I use this and it works ok for me...
In my startup code...
m.Timer=CreateObject("roTimeSpan")
m.Timer.Mark()
m.Development = CreateObject("roAppInfo").IsDev()
And a routine in my global routines
Sub Trace(Value as string)
if m.Development=true print (stri(m.Timer.TotalMilliseconds())+": "+Value)
End Sub
Then I can call it anytime and it prints if in dev, the drawback is if I do a complex function to generate the value, it still runs in production, but the one area I do that I surrounded with the same m.Development check.