Debuglog intermittent?

Hi team,
I’m seeing some strange behaviour on a new project in 2024R2 (Windows 11) with system.debuglog

I have a method that’s called when serial data is received and the actual method works fine. The issue is that I have a number of debug statements in my code that do not show in the debug window.
Is there a way that I’ve somehow disabled the debugger? The strange thing is that it sometimes shows and sometimes doesn’t? It seems that the first few messages come through and then nothing until I restart the debug app.

I ran into this the other day.

The problem occurs when the debuglog receives ASCII 0. This is interpreted as a string terminator and it stops displaying anything after it.

I created a method called DebugLog that takes my debug string and does a .ReplaceAll on Chr(0) to an empty string and then writes it to the debuglog and used that instead.

1 Like

I’ve seen those things when dumping lots of contents and the system is busy. Debuglog seems not queuing all calls and outputting all contents when it has enough time, it seems losing some “timer events” and contents. Writing directly to a file seems safer.

If you write a test app doing like 3 System.Debuglog “whatever” and then quit. You probably will lose all of them. You will need to put a DoEvents() before Quit

If you instead write to a TextOutputStream file, they should be there.

1 Like

Thanks for this, I can almost guarantee this is what’s happening. I wonder if this should be logged as a bug?

Issue #76792.

2 Likes

Looks like it’s already fixed for the next release!

3 Likes

The bug seemed worse than I expected. I was expecting truncation at the null position, not caos ending with the disabling the function.

1 Like