OmixVisualization / qtjambi

QtJambi is a wrapper for using Qt in Java.
http://www.qtjambi.io
Other
354 stars 40 forks source link

Improve QTJAMBI_DEBUG_TRACE feature #149

Closed omix closed 1 year ago

omix commented 1 year ago

The QTJAMBI_DEBUG_TRACE feature is one of the oldest in QtJambi and needs to be revised:

omix commented 1 year ago

This feature is available in next release QtJambi 6.5.1.

omix commented 1 year ago

You may activate method logs by using JVM call parameter -Dio.qt.enable-method-logs=true. This works in both, release and debug build.

QtJambi will log to qDebug() whenever entering and leaving a method as well as further internal states. These messages are logged with different logging categories:

io.qtjambi.debugapi.level=OFF
io.qtjambi.debugapi.native-calls.level=OFF
io.qtjambi.debugapi.java-overloads.level=OFF
io.qtjambi.debugapi.internal.level=OFF

Examples:

Java calling native method:
ENTER: Java calling native method QCoreApplication::applicationName() in thread tid=12345
LEAVE: Java calling native method QCoreApplication::applicationName() in thread tid=12345

ENTER: Java calling native method QEvent::QEvent(QEvent::Type) in thread tid=12345
ENTER: Java calling native method construct QEvent(QEvent::Type) in thread tid=12345
ENTER: Constructor call QEvent::QEvent_shell(QEvent::Type type0) on object 0x16328011420 in thread tid=12345
LEAVE: Constructor call QEvent::QEvent_shell(QEvent::Type type0) on object 0x16328011420 in thread tid=12345
LEAVE: Java calling native method construct QEvent(QEvent::Type) in thread tid=12345
LEAVE: Java calling native method QEvent::QEvent(QEvent::Type) in thread tid=12345
Qt calling overloading Java method:
ENTER: Shell (object: 0x1632800eea0) calling java method QObject::event(QEvent*) in thread tid=12345
LEAVE: Shell (object: 0x1632800eea0) calling java method QObject::event(QEvent*) in thread tid=12345
Internal method calls:
ENTER: QtJambiLink::releaseJavaObject(JNIEnv *env) on object 0x16327e2f750 in thread tid=12345
LEAVE: QtJambiLink::releaseJavaObject(JNIEnv *env) on object 0x16327e2f750 in thread tid=12345
Other messages:
call destructor_function on object 0x7ff8039d76b8 in thread tid=12345