def METHOD_NAME(request, workdir):
    yield
    if hasattr(request.node, 'rep_call') and request.node.rep_call.passed:
        return
    logdir = Path("tests/logs") / session_tag / request.node.nodeid
    candidates = [
        workdir / 'var/log/agent/auto-configure.log',
        workdir / 'var/log/agent/serve.log',
        workdir / 'var/log/temboard-agent/serve.log',
        workdir / 'var/log/temboard-auto-configure.log',
        workdir / 'var/log/temboard/serve.log',
        workdir / 'var/log/ui/auto-configure.log',
        workdir / 'var/log/ui/serve.log',
        workdir / 'var/log/postgresql/postgres.log',
    ]
    copy_files(candidates, logdir)