Connecting Tech Pros Worldwide Forums | Help | Site Map

C++ Debug Messages

Newbie
 
Join Date: Jun 2007
Posts: 25
#1: Jul 20 '07
Hi everybody. I was wondering if there is a way in C++ to have debug messages, and the ability to turn them off. For example, lets say I would like my program to have two modes. One mode is the mode where all the debug messages are printed, and another where they are not. Is it possible to do through the compiler? Ie to choose whether to compile the program with the debug info? I looked some stuff on google, and found some strange way in Visual C++. How about g++? Example would be great too. Thanks in advance.

sicarie's Avatar
Moderator
 
Join Date: Nov 2006
Location: USA
Posts: 3,929
#2: Jul 20 '07

re: C++ Debug Messages


Here's the G++ man page, I'm sure you can figure it out from there ;)
JosAH's Avatar
Expert
 
Join Date: Mar 2007
Posts: 10,611
#3: Jul 20 '07

re: C++ Debug Messages


Have a look at log4C. It's a clone of the famous log4J package.

kind regards,

Jos
Reply