Esempio n. 1
0
def log_msg(server, params):
    try:
        instr = int(params[0])
        instr_txt = instruction_text[instr]
        server.log_debug("%s - msg: %s [%s]" % (server.__class__.__name__, 
            instr_txt, ", ".join(map(str, params[1:]))))
    except:
        # don't die for logging
        pass
Esempio n. 2
0
def log_reply(server, reply):
    try:
        res = reply.split("|")
        code = int(res[0])
        code_txt = instruction_text[code]
        try:
            txt = base64.b64decode(res[1])
        except:
            txt = res[1]
        server.log_debug("%s - reply: %s %s" % (server.__class__.__name__, 
                code_txt, txt))
    except:
        # don't die for logging
        server.log_debug("%s - reply: %s" % (server.__class__.__name__, 
                reply))
        pass