Hi, I’m really new to Xojo.
Does Xojo have a debug log? i.e. something like the Javascript console. I see the errors/messages log, but I don’t know how to write to those logs during debugging.
Thanks.
Hi, I’m really new to Xojo.
Does Xojo have a debug log? i.e. something like the Javascript console. I see the errors/messages log, but I don’t know how to write to those logs during debugging.
Thanks.
I dont know anything about the javascript console. But there is System.Debuglog in Xojo.
System.DebugLog outputs to the Messages pane in the bottom of the Xojo IDE.
Set yourself up an expander, it’s the best way.
I’ve got one that expands NSLog( to System.DebugLog("[cursor]")
It helps for old habits
Thanks for the info on System.DebugLog.
Doc page is here
One more question, is there a way to print the method or function being called? i.e.:
System.DebugLog(FUNCTION)
System.DebugLog(METHOD)
Use CurrentMethodName.
Perfect, Wayne. Thanks.
If you are doing much with debug logging, it may be worth it to wrap in an #If. For example:
#If DebugBuild Then
Dim calculatedValue As Blah = BlahBlah()
System.DebugLog(CurrentMethodName + ": Calculated result is: " + calculatedValue)
#EndIf
This prevents the calculation, the string concat, etc… from taking CPU cycles in your production apps. Although in a production app, the DebugLog does not do anything, even in simple calls everything in the parens is still executed and it goes to a dead function basically.