// ==UserScript==
// @name InstaSynchP Logger
// @namespace InstaSynchP
// @description Log information with different levels
// @version 1.0.3
// @author Zod-
// @source https://github.com/Zod-/InstaSynchP-Logger
// @license MIT
// @include *://instasync.com/r/*
// @include *://*.instasync.com/r/*
// @grant none
// @run-at document-start
// @require https://greasyfork.org/scripts/8159-log4javascript/code/log4javascript.js?version=37575
// @require https://greasyfork.org/scripts/5647-instasynchp-library/code/InstaSynchP%20Library.js?version=37716
// @downloadURL https://update.greasyfork.icu/scripts/8177/InstaSynchP%20Logger.user.js
// @updateURL https://update.greasyfork.icu/scripts/8177/InstaSynchP%20Logger.meta.js
// ==/UserScript==
function Logger(version) {
"use strict";
this.version = version;
this.name = 'InstaSynchP Logger';
this.log = undefined;
this.inPageAppender = undefined;
}
Logger.prototype.executeOnceCore = function () {
"use strict";
var th = this, oldError;
log4javascript.setDocumentReady();
th.log = log4javascript.getDefaultLogger();
th.log.removeAllAppenders();
th.inPageAppender = new log4javascript.InPageAppender(undefined, false, true, true, "100%", "300px");
th.inPageAppender.setShowCommandLine(false);
th.inPageAppender.setShowHideButton(true);
th.inPageAppender.setScrollToLatestMessage(false);
th.log.addAppender(th.inPageAppender);
oldError = th.log.error;
//add a message to chat on an error
th.log.error = function () {
oldError.apply(th.log, arguments);
var message = 'An error has occured in the script. ' +
'Please open the log ' +
'and make a pastebin ' +
'of everything in there and send it to ' +
'me.';
addErrorMessage(message);
};
//add button
$('#tabs_chat_settings_content').append(
$('