Suppressing debug alerts Topic is solved

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
art-ganseforth
Earned some good credits
Earned some good credits
Posts: 147
Joined: Mon Sep 01, 2014 10:14 am

Suppressing debug alerts

Post by art-ganseforth » Sun Jan 15, 2017 2:47 pm

Hi,

i need help because for some reasons i have two dabug-alerts appearing in my program. Both of them are obviously called from somewhere deep inside the wx-library and seem to be not relevat for the application itself, but if the apperar they interrupt the workflow.

Would be good if there would be a way to suppres them, but i tried around a lot with debug-settings and still these messages appear.

Any Idea?

Regards,
Frank

User avatar
doublemax
Moderator
Moderator
Posts: 14893
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Suppressing debug alerts

Post by doublemax » Sun Jan 15, 2017 4:44 pm

Platform, compiler and which asserts?

If these are really asserts, you should fix the problem, not suppressing the message. Some other messages (e.g. trying to open a non-existing file) can be suppressed with wxLogNull.
http://docs.wxwidgets.org/trunk/classwx_log_null.html
Use the source, Luke!

User avatar
xaviou
Super wx Problem Solver
Super wx Problem Solver
Posts: 429
Joined: Mon Aug 21, 2006 3:18 pm
Location: Annecy - France
Contact:

Re: Suppressing debug alerts

Post by xaviou » Sun Jan 15, 2017 5:58 pm

Hi.

You can rebuild your release libs with the "DEBUG_FLAG=0" command line options : all debug asserts will be removes (but you'll also have to add this to the command line for building your app.
You can also add "wxDEBUG_LEVEL=0" while building your app in your IDE's compiler options.

Regards
Xav'
My wxWidgets stuff web page : [email protected]'s wxStuff

art-ganseforth
Earned some good credits
Earned some good credits
Posts: 147
Joined: Mon Sep 01, 2014 10:14 am

Re: Suppressing debug alerts

Post by art-ganseforth » Sun Jan 15, 2017 7:33 pm

@ xaviou:
DEBUG_FLAG=0 doesn't help (experimented already a lot with debug-flags without effect)

@ doublemax:
Win 10 / minGW.
Asserts appear:
a) on (accidetially) pressing a second mouse-button when mouse is captured and
b) when wxTimer->Start is called by a non wx event-function (midi-callback). Message: >>assert "wxThread::IsMain" failed in Start(): timer can only be started from the main thread<<. Note: On pressing 'No' or 'Cancel' the timer is started normally. So obviously the timer can be started from where i do it regardless to the assert.
In both cases after clicking 'Cancel' the program runs fine for hours...

User avatar
cutecode
Super wx Problem Solver
Super wx Problem Solver
Posts: 327
Joined: Fri Dec 09, 2016 7:28 am
Contact:

Re: Suppressing debug alerts

Post by cutecode » Sun Jan 15, 2017 8:28 pm

see this

Code: Select all

	if (!wxMyApp::OnInit())
		return false;

#ifndef _DEBUG
	wxDisableAsserts();
#endif
wx 3.1.4 win/mac/linux

regards,
Alexander Saprykin
https://v2.dental-soft.ru

art-ganseforth
Earned some good credits
Earned some good credits
Posts: 147
Joined: Mon Sep 01, 2014 10:14 am

Re: Suppressing debug alerts

Post by art-ganseforth » Sun Jan 15, 2017 9:09 pm

Thanks! That helped.

Post Reply