Re: [wxpython-users] Automatic exception catching and handling in Python
by Phil Mayes other posts by this author
Jul 8 2008 8:28AM messages near this date
[wxpython-users] Automatic exception catching and handling in Python
|
Re: [wxpython-users] Automatic exception catching and handling in Python
At 08:15 AM 7/8/2008, you wrote:
> Hello,
> I would like to know if there is a way pipe all exceptions and bugs in my
> program directly in a log file.
>
> I already have a function to write in a log, but if an exception or bug
> occurs in a part of my program I didn't expected, the end user will see
> it, while I would like to hide it and keep it in a separate file which
> will be sent to the network administrator.
>
> Any idea ?
Try this:
sys.stderr = sys.stdout = open(fname, 'w', 0)
print '%s trace started on %s (frozen=%s)' % (identity.IDENTITY,
time.ctime(time.time()), hasattr(sys, 'frozen'))
print utils.GetOS()
_______________________________________________
wxpython-users mailing list
wxpython-users@[...].org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
Thread:
Gros Bedo
Phil Mayes
Cody Precord
Mike Rooney
|