Publish vs Debug build

Post Reply
AllanH
Posts: 13
Joined: Sat Nov 26, 2022 5:23 pm

Publish vs Debug build

Post by AllanH »

Q: Is there a way to determine if I am compiling a debug build vs publishing?

I would like to automatically disable verbose logging when I publish but leave it on when developing/debugging. In Visual studio for C++, the compiler defines _DEBUG and NDEBUG respectively to support such compile-time configuration changes.

I could not find anything in ModuleDesignerTestClient.log and ModuleDesigner.log that indicates something along the lines of a defined variable.

Any suggestions would be appreciated
User avatar
seal58
Posts: 377
Joined: Fri Jul 12, 2019 5:28 pm
Location: Rostock, Germany
Contact:

Re: Publish vs Debug build

Post by seal58 »

Hi,

you will have to build your debugging helpers yourself. During development I use to add some code, that creates logs or handles extra controls. This extra code as well as selection of log messages can be switched on and off with IF ( ) statements.

For example I use one boolean variable to switch whole debugging helpers on and off. Several other values are used to config debugging environment.
When module is finished, one can delete such extra code. As I know, Java compiler is so smart, that it ignores code segments that never can be run through because of everlasting FALSE conditions.

BTW: Even when you start debugging with ctrl+F5 (without child process) instead of F5, the code can send log messages with Log() anyway. These will not appear in VMD output pane, but in ModuleDesignerTestClient.log.
AllanH
Posts: 13
Joined: Sat Nov 26, 2022 5:23 pm

Re: Publish vs Debug build

Post by AllanH »

Thanks for the comments. I do have a logging framework that I manage with a few 'final boolean' variables to include or exclude at build time. I had hoped to automatically remove my verbose logging when building a release as the overhead shouldn't be in a published module. Thanks again.
Post Reply

Return to “Module Designer”