Changeset 5708

Show
Ignore:
Timestamp:
08/24/12 16:27:20 (7 years ago)
Author:
cmatthew
Message:

Fixes to logging and fix for exception printing which was causing error messages to not be printed.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • seattle/branches/nacl_repy/seattlelib/lind_server.mix

    r5630 r5708  
    1111VERSION = "$Rev$" 
    1212 
    13 TRACE = False  # Trace system calls? (somewhat like strace)  
     13 
     14SILENT = False # Try to produce output as close as the OS would 
     15               # this means no debug/error messages! 
     16 
     17TRACE = True  # Trace system calls? (somewhat like strace)  
     18 
     19 
    1420 
    1521SYSCALL = "syscall"               # shortcut to syscall dict items 
     
    238244      [magic, call, frmt_len, payload_size, seq_num, valid] = struct_unpack(format, header) 
    239245    except Exception, err: 
    240       log("[ERROR][RPC] Error unmarshaling header" + type(err) + ":" + err + "\n") 
     246      log("[ERROR][RPC] Error unmarshaling header" + str(type(err)) + ":" + str(err) + "\n") 
    241247 
    242248    # validate the header 
     
    253259        expected_seq_num = FIRST_SEQ_NUM 
    254260        booting = False 
    255         print "Booted" 
     261        log("Booted") 
    256262    elif (seq_num != expected_seq_num): 
    257263      pass 
     
    296302      if TRACE: 
    297303        strace_msg.append(str(response)[:128]) 
    298         print ''.join(strace_msg) 
     304        log( ''.join(strace_msg)) 
    299305    mycontext[LOCK].release() 
    300306    if response == None: 
     
    373379def setup_filetable(comp_num): 
    374380  """Try to open file system. If you can't, then make a new one.""" 
    375   print "Opening file system... ", 
     381  log( "Opening file system... ") 
    376382  load_fs() 
    377383 
    378   print "done." 
     384  log( "done.") 
    379385 
    380386  # except KeyError, e: 
     
    417423 
    418424if callfunc == "initialize": 
    419   print "Lind v0." + VERSION[6:-2], "Last commit:", "$Date$"[7:-2] 
     425  log( "Lind v0." + VERSION[6:-2] + "Last commit:" + "$Date$"[7:-2]) 
    420426  parse_commandline() 
    421427  lind_factory()