How to display output from Qt Android service process in QtCreator?
-
wrote on 15 Aug 2020, 20:33 last edited by morte
How to display output from Qt Android service in QtCreator (qDebug() and Log.i() messages) in QtCreator?
'Application output' shows output from main process but service runs in different process. -
How to display output from Qt Android service in QtCreator (qDebug() and Log.i() messages) in QtCreator?
'Application output' shows output from main process but service runs in different process.wrote on 16 Aug 2020, 06:47 last edited by JonB@morte
QtService seems to be a wrapper for Linux demons or Windows services. By definition you won't be able to access any output it produces, since it's in a quite separate process and any output it produces will go elsewhere (probably nowhere). It would be more usual for any output a service wants to produce to go to a file/the system's "event log", but that is done within the service. -
wrote on 19 Aug 2020, 01:26 last edited by
It's not implemented currently on Qt Creator 4.12/4.13.
Created bugreport with suggestion to add that feature https://bugreports.qt.io/browse/QTCREATORBUG-24496 -
It's not implemented currently on Qt Creator 4.12/4.13.
Created bugreport with suggestion to add that feature https://bugreports.qt.io/browse/QTCREATORBUG-24496wrote on 19 Aug 2020, 11:14 last edited by@morte
Good luck for them choosing or being able to do anything about it. Since, as you say, the service is running in a separate process I don't think you'll get the debug output from that process while you are debugging your main process.... -
@morte
Good luck for them choosing or being able to do anything about it. Since, as you say, the service is running in a separate process I don't think you'll get the debug output from that process while you are debugging your main process.... -
wrote 4 days ago last edited by
So I have to manually search for keywords to get the desired output highlighted in the console, when using adb logcat.
Some people suggest filtering the output using the app package name, but not all output contains it.
If anyone has a workaround that detects all of the package's output, that'd be great.
Thanks
-
wrote 4 days ago last edited by piervalli
On Windows I use
adb logcat | findstr appnameReplace the name with tag.
On the version 5.15.2 there was a bug that not write on console on android, but there is a easy workaround. (Now I am out of my office)
adb is very powerful you can use shell for example LS or copy in PC logs files -
On Windows I use
adb logcat | findstr appnameReplace the name with tag.
On the version 5.15.2 there was a bug that not write on console on android, but there is a easy workaround. (Now I am out of my office)
adb is very powerful you can use shell for example LS or copy in PC logs fileswrote 3 days ago last edited by@piervalli But that's text-based filtering, which doesn't fully work because not all output contains the app tag, as I mentioned.
-
wrote 3 days ago last edited by
I use a custom qInstallMessageHandler
Have you tested with method?
__android_log_print(priority, "Qt", "%s", qPrintable(fMessage)); -
I use a custom qInstallMessageHandler
Have you tested with method?
__android_log_print(priority, "Qt", "%s", qPrintable(fMessage));wrote 3 days ago last edited by@piervalli Oh, that's new, I'll try it out.
Thanks!