ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> wxpython-users
wxpython-users
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved