private function _writeError($check, $message, $lineNumber = null, $level = null) {
		if ($lineNumber === null) {
			$lineNumber = $this->lineNumber;
		}

		// If level not specified, get it in the config
		if ($level === null) {
			$level = $this->_config->getTestLevel($check);
			// If level not found in the config then WARNING by default.
			if ($level === null) {
				$level = WARNING;
			}
		}

		$this->errorCounts[$level] ++;

		$this->_reporter->writeError($lineNumber, $check, $message, $level);
	}