def METHOD_NAME(dummy_state: State, tmp_path: pathlib.Path):
    log_file_name = os.path.join(tmp_path, 'output.log')
    log_destination = FileLogger(filename=log_file_name,
                                 buffer_size=1,
                                 flush_interval=1,
                                 capture_stderr=True,
                                 capture_stdout=True)
    # capturing should start immediately
    print('Hello, stdout!\nExtra Line')
    print('Hello, stderr!\nExtra Line2', file=sys.stderr)
    logger = Logger(dummy_state, destinations=[log_destination])
    log_destination.run_event(Event.INIT, dummy_state, logger)
    log_destination.run_event(Event.EPOCH_START, dummy_state, logger)
    log_destination.run_event(Event.BATCH_START, dummy_state, logger)
    log_destination.run_event(Event.BATCH_END, dummy_state, logger)
    log_destination.close(dummy_state, logger)
    with open(log_file_name, 'r') as f:
        assert f.readlines() == [
            '[stdout]: Hello, stdout!\n',
            '[stdout]: Extra Line\n',
            '[stderr]: Hello, stderr!\n',
            '[stderr]: Extra Line2\n',
        ]