DebugLog Crash

Is this a regression on a recent Xojo build? If you create a new Desktop project and put this in the Open event of the Window:

Dim i As UInt8 = 0 Xojo.System.DebugLog(i.ToText)

The app crashes with a segmentation fault. Seems to relate to the ToText extension method. This is on Mojave using Xojo 2018 R4.

In testing this issue, it appears Xojo.System.DebugLog doesn’t do anything with a literal value in a Desktop project on Mac OS 10.14.3. I’m not seeing my test phrase in either Console or the messages pane.

You can use Str() as an alternative. Perhaps file a Bug report to have it maybe fixed asap?

There doesn’t seem to be a .ToText for UInt8 in the docs:

For double, integer etc there it’s documented.

I’ll do a bug report. Using Str() circumvents the issue but won’t work on iOS.

Is this Desktop or iOS? Your post only talks about a Desktop project.
I ask because Xojo.System.DebugLog isn’t usable on Mac Desktop in my testing.

On desktop.

That’s because macOS 10.14 has the new improved console! Logs ever single thing that Apple processes do wrong, but it’s impossible to find anything related to your application.

In the search field, enter the full name of your application and press enter. Then the search field will change and there’s a tiny popup menu in front of the application name, click on it and change it from “Any” to “Process”. You’ll get some stuff, but not all.

Make sure you can see the sidebar, then click on “All Messages” and use the search field to enter in your application name.

Last thing (option I’ve chosen) is to create your own logging system.

Submitted a Feedback case (ID: 55286).

This is definitely a significant bug:

[code]Dim a As Integer = 10
//Xojo.System.DebugLog(a.ToText) // Crashes
//Xojo.System.DebugLog(Str(a).ToText) // Crashes

Dim t As Text = a.ToText
Xojo.System.DebugLog(t) // Crashes

//Xojo.System.DebugLog(“Test”) // Works[/code]

A workaround is to use REALBasic.System.DebugLog instead of Xojo.System.DebugLog. Of course, this means it won’t work on iOS.