Changeset 1120


Ignore:
Timestamp:
11/20/06 12:04:32 (7 years ago)
Author:
mglb1
Message:
  • Disable the traceback log by default
  • Handle any errors that may occur while writing the traceback log
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ccsd/trunk/crcnetd/_utils/ccsd_log.py

    r1005 r1120  
    4747    if len(tb) <= 0 and msg == "": 
    4848        return 
    49     _debugLog = config_get("ccsd", "traceback_log", "/tmp/ccsd_tbs.log") 
    50     fd = open(_debugLog, "a") 
    51     fd.write("%s\n" % time.ctime()) 
    52     if msg!="": fd.write("%s\n" % msg) 
    53     for line in tb: fd.write(line) 
    54     fd.write("") 
    55     fd.close() 
     49    _debugLog = config_get(None, "traceback_log", None) 
     50    if _debugLog is not None: 
     51        try: 
     52            fd = open(_debugLog, "a") 
     53            fd.write("%s\n" % time.ctime()) 
     54            if msg!="": fd.write("%s\n" % msg) 
     55            for line in tb: fd.write(line) 
     56            fd.write("") 
     57            fd.close() 
     58        except: 
     59            (etype, value, etb) = sys.exc_info() 
     60            log_error("Failed to write traceback logfile- %s" % value) 
    5661 
    5762def log_debug(msg, exc_info=None): 
Note: See TracChangeset for help on using the changeset viewer.