Instead of always logging C++ assertions, added wxPYAPP_ASSERT_LOG
flag to turn it on. In most cases turning it into an exception (the default behavior) is enough. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@19671 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -17,9 +17,16 @@ unicode.
|
|||||||
Fixed problem where the wrong class name could sometimes be used for
|
Fixed problem where the wrong class name could sometimes be used for
|
||||||
OOR.
|
OOR.
|
||||||
|
|
||||||
Fixed a interpreter lock problem in the __eq__ and __ne__ methods in
|
Fixed an interpreter lock problem in the __eq__ and __ne__ methods in
|
||||||
wxSize and etc.
|
wxSize and etc.
|
||||||
|
|
||||||
|
Updated PyCrust to version 0.9
|
||||||
|
|
||||||
|
Instead of always logging C++ assertions, added wxPYAPP_ASSERT_LOG
|
||||||
|
flag to turn it on. In most cases turning it into an exception (the
|
||||||
|
default behavior) is enough. See below in the 2.3.4.1 notes for more
|
||||||
|
details.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -198,11 +198,6 @@ void wxPyApp::OnAssert(const wxChar *file,
|
|||||||
buf += msg;
|
buf += msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send it to the normal log destination, but only if
|
|
||||||
// not _DIALOG because it will call this too
|
|
||||||
if ( !(m_assertMode & wxPYAPP_ASSERT_DIALOG))
|
|
||||||
wxLogDebug(buf);
|
|
||||||
|
|
||||||
// set the exception
|
// set the exception
|
||||||
wxPyBeginBlockThreads();
|
wxPyBeginBlockThreads();
|
||||||
PyObject* s = wx2PyString(buf);
|
PyObject* s = wx2PyString(buf);
|
||||||
@@ -215,6 +210,20 @@ void wxPyApp::OnAssert(const wxChar *file,
|
|||||||
// NULL, signalling the exception to Python.
|
// NULL, signalling the exception to Python.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Send it to the normal log destination, but only if
|
||||||
|
// not _DIALOG because it will call this too
|
||||||
|
if ( (m_assertMode & wxPYAPP_ASSERT_LOG) && !(m_assertMode & wxPYAPP_ASSERT_DIALOG)) {
|
||||||
|
wxString buf;
|
||||||
|
buf.Alloc(4096);
|
||||||
|
buf.Printf(wxT("%s(%d): assert \"%s\" failed"),
|
||||||
|
file, line, cond);
|
||||||
|
if (msg != NULL) {
|
||||||
|
buf += wxT(": ");
|
||||||
|
buf += msg;
|
||||||
|
}
|
||||||
|
wxLogDebug(buf);
|
||||||
|
}
|
||||||
|
|
||||||
// do the normal wx assert dialog?
|
// do the normal wx assert dialog?
|
||||||
if (m_assertMode & wxPYAPP_ASSERT_DIALOG)
|
if (m_assertMode & wxPYAPP_ASSERT_DIALOG)
|
||||||
wxApp::OnAssert(file, line, cond, msg);
|
wxApp::OnAssert(file, line, cond, msg);
|
||||||
|
@@ -427,7 +427,8 @@ void wxPyCBH_delete(wxPyCallbackHelper* cbh);
|
|||||||
enum {
|
enum {
|
||||||
wxPYAPP_ASSERT_SUPPRESS = 1,
|
wxPYAPP_ASSERT_SUPPRESS = 1,
|
||||||
wxPYAPP_ASSERT_EXCEPTION = 2,
|
wxPYAPP_ASSERT_EXCEPTION = 2,
|
||||||
wxPYAPP_ASSERT_DIALOG = 4
|
wxPYAPP_ASSERT_DIALOG = 4,
|
||||||
|
wxPYAPP_ASSERT_LOG = 8
|
||||||
};
|
};
|
||||||
|
|
||||||
class wxPyApp: public wxApp
|
class wxPyApp: public wxApp
|
||||||
|
@@ -68,7 +68,8 @@ wxSize wxDefaultSize;
|
|||||||
enum {
|
enum {
|
||||||
wxPYAPP_ASSERT_SUPPRESS = 1,
|
wxPYAPP_ASSERT_SUPPRESS = 1,
|
||||||
wxPYAPP_ASSERT_EXCEPTION = 2,
|
wxPYAPP_ASSERT_EXCEPTION = 2,
|
||||||
wxPYAPP_ASSERT_DIALOG = 4
|
wxPYAPP_ASSERT_DIALOG = 4,
|
||||||
|
wxPYAPP_ASSERT_LOG = 8
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user