def log_invocation(fn='/tmp/reflex_invoc.log'):
    """ log invocation of actor for easy reexecution with:
        eval $(cat /tmp/reflex_invoc.log)
    """
    import sys
    #import os
    #if 'REFLEX_DEBUG' not in os.environ:
    #    return
    try:
        with open(fn, 'w') as f:
            s = " ".join(['"%s"' % x for x in sys.argv])
            f.write('python ' + s + '\n')
    except:
        pass
