Logging messages

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
amititz
Earned a small fee
Earned a small fee
Posts: 15
Joined: Tue Dec 20, 2005 7:06 am

Logging messages

Post by amititz » Wed Jan 11, 2006 4:53 am

Hi,

I would like to use wxLogWindow to display logging messages in a logging build configuration. Obviously i don't want these messages to appear to the end user in release mode. However, if i'm using wxLogDebug, the messages are displayed only in debug mode. I can't use debug mode for my tests, i need to test the release mode, but still see the log messages.

What should i do?

Thanks!

Bundy
I live to help wx-kind
I live to help wx-kind
Posts: 153
Joined: Fri Apr 29, 2005 9:46 am
Location: Poland

Post by Bundy » Wed Jan 11, 2006 11:06 am

The easiest way is to put wxLogMessage in #ifdef LOGBUILD / #endif. Just define this LOGBUILD into Your program in log build.

Regards, Bundy
"Fate rewards prepared mind"

Quote from movie "Liberator 2"

amititz
Earned a small fee
Earned a small fee
Posts: 15
Joined: Tue Dec 20, 2005 7:06 am

Post by amititz » Thu Jan 12, 2006 5:29 am

Thanks.

Isn't there a simple way to tell wxWidgets (and not my application) not to process all the wxLogMessage messages?
(of course, i'm also interested in the performance gain, not just to have a log target that doesn't do anything...)

rabbittW
In need of some credit
In need of some credit
Posts: 6
Joined: Thu Jun 29, 2006 8:42 pm

__WXDEBUG__ disable

Post by rabbittW » Tue Jul 18, 2006 8:06 pm

According to the quote in the documentation for the WxLogDebug fucntion, "The right functions for debug output. They only do something in debug mode (when the preprocessor symbol __WXDEBUG__ is defined) and expand to nothing in release mode (otherwise)." This should mean that if __WXDEBUG__ is undefined, then wxLogDebug should do nothing. However, if I try to compile without __WXDEBUG__ defined, I get undefined references to wxAssert. Techincally I can't use a "Release Mode" unless I remove all my calls to wxLogDebug (or use an ugly #ifdef for the function call, yuk). Does anyone know if this is a bug being tracked?? I spoke about my compilation problems to get the logging functions to work in this post,

http://forums.wxwidgets.org/viewtopic.p ... highlight=

and this was great! Now I can't turn the debug off! :)

-R

Post Reply