<commit_before>/**
 * @author cargomedia.ch
 */
(function() {
	if (jserror) {
		return;
	}
	var jserror = {
		/** @type Function|Null */
		onerrorBackup: null,

		/** @type String */
		logUrl: null,

		/** @type Number */
		counter: 0,

		/**
		 * @param {String} logUrl
		 * @param {Boolean} [suppressErrors]
		 */
		install: function(logUrl, suppressErrors) {
			this.logUrl = logUrl;
			if (window.onerror) {
				this.onerrorBackup = window.onerror;
			}
			window.onerror = function(message, fileUrl, fileLine) {
				var originatesFromLogging = (fileUrl.indexOf(jserror.logUrl) >= 0);
				var detailsUnavailable = (0 === fileLine);
				if (!originatesFromLogging && !detailsUnavailable) {
					jserror.log(message, fileUrl, fileLine);
				}
				if (jserror.onerrorBackup) {
					jserror.onerrorBackup(message, fileUrl, fileLine);
				}
				if (suppressErrors) {
					return true;
				}
			}
		},

		/**
		 * @param {String} message
		 * @param {String} fileUrl
		 * @param {Number} fileLine
		 */
		log: function(message, fileUrl, fileLine) {
			var src = this.logUrl;
			src += '?counter=' + (this.counter++);
			src += "&url=" + encodeURIComponent(document.location.href);
			src += "&message=" + encodeURIComponent(message.trim().substr(0, 10000));
			src += "&fileUrl=" + encodeURIComponent(fileUrl);
			src += "&fileLine=" + fileLine;
			this._appendScript(src);
		},

		/**
		 * @param {String} src
		 */
		_appendScript: function(src) {
			var script = document.createElement('script');
			script.src = src;
			script.type = 'text/javascript';
			document.getElementsByTagName('head')[0].appendChild(script);
		}
	};

	jserror.install('/jserror/null');

}).call(this);<commit_msg>Make logging suppression when no details configurable, log them for now<commit_after>/**
 * @author cargomedia.ch
 */
(function() {
	if (jserror) {
		return;
	}
	var jserror = {
		/** @type Function|Null */
		onerrorBackup: null,

		/** @type String */
		logUrl: null,

		/** @type Number */
		counter: 0,

		/**
		 * @param {String} logUrl
		 * @param {Boolean} [suppressErrors]
		 * @param {Boolean} [suppressWithoutDetails]
		 */
		install: function(logUrl, suppressErrors, suppressWithoutDetails) {
			this.logUrl = logUrl;
			if (window.onerror) {
				this.onerrorBackup = window.onerror;
			}
			window.onerror = function(message, fileUrl, fileLine) {
				var originatesFromLogging = (fileUrl.indexOf(jserror.logUrl) >= 0);
				var detailsUnavailable = (0 === fileLine);
				var suppressLogging = originatesFromLogging || (suppressWithoutDetails && detailsUnavailable);
				if (!suppressLogging) {
					jserror.log(message, fileUrl, fileLine);
				}
				if (jserror.onerrorBackup) {
					jserror.onerrorBackup(message, fileUrl, fileLine);
				}
				if (suppressErrors) {
					return true;
				}
			}
		},

		/**
		 * @param {String} message
		 * @param {String} fileUrl
		 * @param {Number} fileLine
		 */
		log: function(message, fileUrl, fileLine) {
			var src = this.logUrl;
			src += '?counter=' + (this.counter++);
			src += "&url=" + encodeURIComponent(document.location.href);
			src += "&message=" + encodeURIComponent(message.trim().substr(0, 10000));
			src += "&fileUrl=" + encodeURIComponent(fileUrl);
			src += "&fileLine=" + fileLine;
			this._appendScript(src);
		},

		/**
		 * @param {String} src
		 */
		_appendScript: function(src) {
			var script = document.createElement('script');
			script.src = src;
			script.type = 'text/javascript';
			document.getElementsByTagName('head')[0].appendChild(script);
		}
	};

	jserror.install('/jserror/null', false, false);

}).call(this);
{'fraction_non_alphanumeric': 0.1627260083449235, 'fraction_numerical': 0.005563282336578581, 'mean_word_length': 3.456009913258984, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2003737', 'n_tokens_mistral': 1437, 'n_tokens_neox': 1193, 'n_words': 241}