Why is this inside the if-statement? Aren't logging and waiting orthogonal?