Use $this->log() and isset instead of !empty().