Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic log to serial only debug (Read 1522 times)
BH
Newbies
*
Offline


Posts: 1
Joined: May 17th, 2018
log to serial only debug
May 17th, 2018 at 10:58pm
Print Post  
How can I log to the serial port only in debug mode?
Thanks
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: log to serial only debug
Reply #1 - May 17th, 2018 at 11:22pm
Print Post  
Couple of options.

1) If you want to only send serial when visual micro debug is enabled then use VM_DEBUG
Code (C++)
Select All
 #if [b]defined(VM_DEBUG)[/b]

 #endif
 




OR

2) If you want to enable the more common _DEBUG constant based upon the currently selected configuration such as "Release" or "Debug" then enter an integer value > 0 for "Define _DEBUG constant" property in the visual micro project properties list. Use _DEBUG as a define in your code similar to above. 

Code (C++)
Select All
#if defined(_DEBUG) && _DEBUG = 1

 #endif
 



Project Properties: right-click the project name in the explorer>properties
« Last Edit: May 17th, 2018 at 11:25pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint