public function sendLogsTo(LogConsumer $logConsumer)
    {
        if ($logConsumer === $this) {
            throw new LogicException('Operation not allowed');
        }
        
        while (!empty($this->collectedLogs)) {
            $log = array_shift($this->collectedLogs);
            $logConsumer->consumeLog($log['message'], $log['context']);
        }
    }
public function sendLogsTo(LogConsumer $logConsumer)
    {
        if ($logConsumer === $this) {
            throw new LogicException('Operation not allowed');
        }
        
        while (!empty($this->collectedLogs)) {
            $log = array_shift($this->collectedLogs);
            $logConsumer->consumeLog($log['message'], $log['context']);
        }
    }
public function sendLogsTo ( LogConsumer $ logConsumer ) { if ( $ logConsumer === $ this ) { throw new LogicException ( 'Operation not allowed' ) ; } while ( ! empty ( $ this -> collectedLogs ) ) { $ log = array_shift ( $ this -> collectedLogs ) ; $ logConsumer -> consumeLog ( $ log [ 'message' ] , $ log [ 'context' ] ) ; } }
Send all logs to other LogConsumer.
Be aware that logs are removed during this process.

@param LogConsumer $logConsumer
@throws LogicException
@return void
Send all logs to other LogConsumer . Be aware that logs are removed during this process .