Changeset 1762

Show
Ignore:
Timestamp:
09/11/08 11:39:16 (18 months ago)
Author:
JensDiemer
Message:

comment the warnings redirect

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pylucid_project/PyLucid/__init__.py

    r1751 r1762  
    4646It's for "handle egg warning...":http://pylucid.net:8080/pylucid/ticket/195 
    4747""" 
    48 import warnings, logging 
    49  
    50 # Needs to have the file rights to create/write into this file! 
    51 LOGFILE = "PyLucid_warnings.log" 
    52  
    53 try: 
    54     logging.basicConfig( 
    55         level=logging.DEBUG, 
    56         format='%(asctime)s %(levelname)s %(message)s', 
    57         filename=LOGFILE, 
    58         filemode='a' 
    59     ) 
    60 except IOError, err: 
    61     raise IOError("Can't setup low level warning redirect: %s" % err) 
    62  
    63 log = logging.debug 
    64 log("PyLucid warnings logging started.") 
    65  
    66 warning_container = [] 
    67  
    68 def showwarning(message, category, filename, lineno): 
    69  
    70     msg = unicode(message) 
    71     filename = u"..." + filename[-30:] 
    72     msg += u" (%s - line %s)" % (filename, lineno) 
    73  
    74     log(msg) 
    75  
    76 old_showwarning = warnings.showwarning 
    77 warnings.showwarning = showwarning 
     48#import warnings, logging 
     49# 
     50## Needs to have the file rights to create/write into this file! 
     51#LOGFILE = "PyLucid_warnings.log" 
     52# 
     53#try: 
     54#    logging.basicConfig( 
     55#        level=logging.DEBUG, 
     56#        format='%(asctime)s %(levelname)s %(message)s', 
     57#        filename=LOGFILE, 
     58#        filemode='a' 
     59#    ) 
     60#except IOError, err: 
     61#    raise IOError("Can't setup low level warning redirect: %s" % err) 
     62# 
     63#log = logging.debug 
     64#log("PyLucid warnings logging started.") 
     65# 
     66#warning_container = [] 
     67# 
     68#def showwarning(message, category, filename, lineno): 
     69# 
     70#    msg = unicode(message) 
     71#    filename = u"..." + filename[-30:] 
     72#    msg += u" (%s - line %s)" % (filename, lineno) 
     73# 
     74#    log(msg) 
     75# 
     76#old_showwarning = warnings.showwarning 
     77#warnings.showwarning = showwarning