<div dir="ltr"><div>awesome, this works, thanks Kálmán!</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 24, 2020 at 8:31 PM Kálmán Viktor <<a href="mailto:viktorvector@gmail.com" target="_blank">viktorvector@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">You can add it like this, not sure if this would help. (maybe wrap the whole thing in an if that checks if you are on android or not)<div><br></div><div>class QtHandler(logging.Handler):<br> def __init__(self):<br> logging.Handler.__init__(self)<br> self.qt_message_logger = QMessageLogger()<br><br> def emit(self, record):<br> record = self.format(record)</div><div> # I think you can get log level from the record and use the correct method of qt_message_logger based on that<br> self.qt_message_logger.debug(record.encode("utf-8"))<br><br>qtHandler = QtHandler()<br>logger = logging.getLogger(__name__)<br>logger.addHandler(qtHandler)</div><div><br></div><div>(forgot to include the list previously)</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Rodrigo Oliveira <<a href="mailto:rodrigo.oliveira@byne.com.br" target="_blank">rodrigo.oliveira@byne.com.br</a>> ezt írta (időpont: 2020. ápr. 20., H, 5:12):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div>Hi, I'm porting an existing application to Android.
It's already working, but can't manage to print/log messages on logcat
(Qt 5.12.3 (arm64_v8a), PyQt 5.12.3, sip 4.19.18 and pyqtdeploy 2.5.1).</div><div><div><br></div><div>I can use 'console.log' from QML, but print and logging from python doesn't show on adb logcat.</div><div>Also, tried qDebug, but the application crashes (QtCore is listed both on sysroot.json and on the pdy file.<br></div></div><div><br></div><div>Anyone experimented or know how to solve this? Am I missing something?</div><div><br></div><div>Many thanks,</div><div>Rodrigo Oliveira</div></div></div>
_______________________________________________<br>
PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com" target="_blank">PyQt@riverbankcomputing.com</a><br>
<a href="https://www.riverbankcomputing.com/mailman/listinfo/pyqt" rel="noreferrer" target="_blank">https://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br>
</blockquote></div>
</blockquote></div>