def printException (ex_args):
    data = {}
    try:
        if isinstance(ex_args, tuple):
            data[ex_args[0]] = ex_args[1]
        else:
            data['state'] = ex_args[0]['state']
            if ex_args[0]['data']:
                for k,v in ex_args[0]['data'].items():
                    if k in ['ip', 'start', 'sender', 'recipients', 'subject']:
                        data[k] = v
    except IndexError as i:
        pass
    except __HOLE__ as k:
        pass
    print 'Exception:', time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime()), data
dataset/ETHPy150Open dpapathanasiou/intelligent-smtp-responder/server/smtp_server.py/printException