Don't check for debug mode too early

Otherwise we can't enable it during operation
This commit is contained in:
JC Brand 2019-04-16 13:59:04 +02:00
parent 4eb6df92c6
commit 3c988240d1
3 changed files with 25 additions and 19 deletions

14
dist/converse.js vendored
View File

@ -63562,15 +63562,17 @@ function setUpXMLLogging() {
_converse.log(msg, level); _converse.log(msg, level);
}; };
if (_converse.debug) { _converse.connection.xmlInput = function (body) {
_converse.connection.xmlInput = function (body) { if (_converse.debug) {
_converse.log(body.outerHTML, strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].LogLevel.DEBUG, 'color: darkgoldenrod'); _converse.log(body.outerHTML, strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].LogLevel.DEBUG, 'color: darkgoldenrod');
}; }
};
_converse.connection.xmlOutput = function (body) { _converse.connection.xmlOutput = function (body) {
if (_converse.debug) {
_converse.log(body.outerHTML, strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].LogLevel.DEBUG, 'color: darkcyan'); _converse.log(body.outerHTML, strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].LogLevel.DEBUG, 'color: darkcyan');
}; }
} };
} }
function finishInitialization() { function finishInitialization() {

View File

@ -150,7 +150,7 @@ _converse.CONNECTION_STATUS = {
7: 'DISCONNECTING', 7: 'DISCONNECTING',
8: 'ATTACHED', 8: 'ATTACHED',
9: 'REDIRECT', 9: 'REDIRECT',
10: 'RECONNECTING', 10: 'RECONNECTING',
}; };
_converse.SUCCESS = 'success'; _converse.SUCCESS = 'success';
@ -441,14 +441,16 @@ function setUpXMLLogging () {
Strophe.log = function (level, msg) { Strophe.log = function (level, msg) {
_converse.log(msg, level); _converse.log(msg, level);
}; };
if (_converse.debug) { _converse.connection.xmlInput = function (body) {
_converse.connection.xmlInput = function (body) { if (_converse.debug) {
_converse.log(body.outerHTML, Strophe.LogLevel.DEBUG, 'color: darkgoldenrod'); _converse.log(body.outerHTML, Strophe.LogLevel.DEBUG, 'color: darkgoldenrod');
}; }
_converse.connection.xmlOutput = function (body) { };
_converse.connection.xmlOutput = function (body) {
if (_converse.debug) {
_converse.log(body.outerHTML, Strophe.LogLevel.DEBUG, 'color: darkcyan'); _converse.log(body.outerHTML, Strophe.LogLevel.DEBUG, 'color: darkcyan');
}; }
} };
} }

View File

@ -42074,15 +42074,17 @@ function setUpXMLLogging() {
_converse.log(msg, level); _converse.log(msg, level);
}; };
if (_converse.debug) { _converse.connection.xmlInput = function (body) {
_converse.connection.xmlInput = function (body) { if (_converse.debug) {
_converse.log(body.outerHTML, strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].LogLevel.DEBUG, 'color: darkgoldenrod'); _converse.log(body.outerHTML, strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].LogLevel.DEBUG, 'color: darkgoldenrod');
}; }
};
_converse.connection.xmlOutput = function (body) { _converse.connection.xmlOutput = function (body) {
if (_converse.debug) {
_converse.log(body.outerHTML, strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].LogLevel.DEBUG, 'color: darkcyan'); _converse.log(body.outerHTML, strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].LogLevel.DEBUG, 'color: darkcyan');
}; }
} };
} }
function finishInitialization() { function finishInitialization() {