waiting channel and writing logs