RE: Unusual Exception Behaviour

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Robert Rawlins

    RE: Unusual Exception Behaviour

    Hi MK,
    >>Robert Rawlins wrote:
    >>
    >I certainly like that implementation for logging the exceptions, however,
    at
    >the moment I don't even know where the exceptions are occurring, or what
    >type they are, could I still use this method to log any and all
    exceptions
    >raised in the application?
    Remember, Google is your friend, here's the crux of the method without
    the fancy schmancy sugar coating:
    >
    >

    ck-into-log-file/
    >
    if __name__=="__ma in__":
    try:
    main()
    except:
    print "Trigger Exception, traceback info forward to log file."
    traceback.print _exc(file=open( "errlog.txt","a "))
    sys.exit(1)
    >
    I've just given this solution a shot but I still seem to get the same
    result, it suddenly starts dumping the log data to the command line, and
    nothing gets printed in error.txt apart from the keyboard interrupt from
    when I kill the application.

    For some reason the exceptions don't seem to be raised properly so obviously
    aren't being caught at this higher level.

    So confusing.

Working...