No logger output in Visual Studio 2019?

I am using Visual Studio 2019 on Windows 10 with a JUCE audio plugin made using the Projucer. I am running it in standalone (.exe) mode.

I have tried using: DBG(), Logger::outputDebugString(), and std::cout() with various kinds of outputs: int, strings, etc.

I don’t get any output from the immediate window or the output.

I have tried putting code to close the JUCE application to make sure it does reach that section of the code.

Any advice on getting the logger to work in Visual Studio? Thanks.

In contrast to Mac or Linux, a Windows GUI application does not come with a console by default. Therefore, std::cout and printf won’t appear anywhere unless you create an additional console, but that’s outside of the scope of this topic. However, DBG writes to stdout on Mac/Linux and to the Debug Output on Windows, so it should work. Are you sure that you opened the debug output window in Visual Studio? Note: This only works if you compile a debug build.

Not sure where exactly you placed that print, but did you set a breakpoint before your print statement just to make sure that this line of code is really executed?

1 Like

Hi Penguin, thanks for the help!

When I made this post I did not know it was possible to debug an exe from Visual Studio. I am just building the exe from the Projucer although I have the usual options (VST3, AU, etc) since I am making an audio plugin. It seems that testing the VST3/AU/etc is vastly more tedious because you can’t do it in Visual Studio, it seems?

Should I only get the debug messages when I run the program in Debug mode in Visual Studio? Before I was running the .exe just by double clicking it from File Explorer, and I was thinking the logs would show up in Visual Studio.

If I run the .exe (the standalone mode of the plugin) using Debug in Visual Studio, I can see a message from DBG() in the output, but the logs are noisy because they have all these lines:

‘Bob.exe’ (Win32): Loaded ‘C:\Windows\System32\CoreMessaging.dll’.
‘Bob.exe’ (Win32): Unloaded ‘C:\Windows\System32\CoreMessaging.dll’
‘Bob.exe’ (Win32): Loaded ‘C:\Windows\System32\ntmarta.dll’.
‘Bob.exe’ (Win32): Loaded ‘C:\Windows\System32\sspicli.dll’.

Do you know if there is any way I can get Visual Studio to not show these JUCE built in methods? I don’t mind seeing these when building for example but it is annoying when debugging.

Thanks

Those Loaded/Unloaded messages are not JUCE related messages. And they should generally only appear at startup. You can also see your debug output without VS, by using a tool like

1 Like

cpr thanks, I did not know applications existed for this feature!

I think I will use the Debug window in Visual Studio instead but it is nice to know this is a feature. Thanks