logging MY application's stderr in runtime

105 views
Skip to first unread message

Chris Smith

unread,
Oct 1, 2011, 3:59:29 AM10/1/11
to PyInstaller
I'm trying to use pyinstaller to package a pyside/qt app. We used
py2exe before, but we switched for some reason and I want to know how
to do something that py2exe did. With py2exe whenever our application
would throw an exception you would get an alert box telling that there
was a error and the location of the log file with the traceback of
said error. The default behavior of pyinstaller seems to be to dump
the stderr of my app to nowhere. I can of course use "2> log.txt" to
get it, but I could have used py2exe's handling of this in the field
and asked super competent users (or sub-par testers) to send me a log
file. pyinstaller's debug mode is not meant for this. Sooo how can I
get some similar functionality out of pyinstaller? Thanks for your
help, switching back to py2exe would be a pain!

Martin Zibricky

unread,
Oct 1, 2011, 10:59:20 AM10/1/11
to pyins...@googlegroups.com
Chris Smith píše v So 01. 10. 2011 v 00:59 -0700:

> I can of course use "2> log.txt" to
> get it, but I could have used py2exe's handling of this in the field
> and asked super competent users (or sub-par testers) to send me a log
> file. pyinstaller's debug mode is not meant for this. Sooo how can I
> get some similar functionality out of pyinstaller?

I think there is nothing similar in pyinstaller. But maybe others could
share any experiences with this.

Maybe the pyinstaller's debug mode could be somehow improved.

How is this implemented in py2exe?

Giovanni Bajo

unread,
Oct 1, 2011, 11:24:38 AM10/1/11
to pyins...@googlegroups.com


The only way to implement such a feature is to install an exception handler in Python. I think it's a feature that could make sense for PyInstaller: when console is disabled, an exception handler should be installed that logs exceptions to log files and/or display a message box using the OS native GUI support, possibly through a different process not to create weird interactions with any running GUI in the user's application.

Obviously this would be a debug feature that can be disabled if not needed.
--
Giovanni Bajo :: ra...@develer.com
Develer S.r.l. :: http://www.develer.com

My Blog: http://giovanni.bajo.it


Hartmut Goebel

unread,
Oct 4, 2011, 4:38:28 AM10/4/11
to pyins...@googlegroups.com
Am 01.10.2011 17:24, schrieb Giovanni Bajo:
> The only way to implement such a feature is to install an exception handler in Python. I think it's a feature that could make sense for PyInstaller: when console is disabled, an exception handler should be installed that logs exceptions to log files and/or display a message box using the OS native GUI support, possibly through a different process not to create weird interactions with any running GUI in the user's application.

Added a ticket for this: http://www.pyinstaller.org/ticket/430

--
Schönen Gruß - Regards
Hartmut Goebel
Dipl.-Informatiker (univ.), CISSP, CSSLP

Goebel Consult
Spezialist für IT-Sicherheit in komplexen Umgebungen
http://www.goebel-consult.de

Monatliche Kolumne: http://www.cissp-gefluester.de/
Goebel Consult ist Mitglied bei http://www.7-it.de

Reply all
Reply to author
Forward
0 new messages