Disable debug logs in production
console.debug logs cause some performance issues because the browser is forced to save the logged objects just in case the user opens the debugging tools. They can be force-enabled back by adding ?debug=1 to the URL. Only console.debug is disabled, console.log and other levels are a lot less verbose and still enabled by default.
This commit is contained in:
parent
07c9cdebb6
commit
93ba0e6443
3 changed files with 23 additions and 2 deletions
|
@ -76,6 +76,7 @@ export default class Client extends EventTarget {
|
|||
saslExternal: false,
|
||||
bouncerNetwork: null,
|
||||
};
|
||||
debug = false;
|
||||
batches = new Map();
|
||||
autoReconnect = true;
|
||||
reconnectTimeoutID = null;
|
||||
|
@ -225,7 +226,9 @@ export default class Client extends EventTarget {
|
|||
}
|
||||
|
||||
let msg = irc.parseMessage(event.data);
|
||||
console.debug("Received:", msg);
|
||||
if (this.debug) {
|
||||
console.debug("Received:", msg);
|
||||
}
|
||||
|
||||
// If the prefix is missing, assume it's coming from the server on the
|
||||
// other end of the connection
|
||||
|
@ -653,7 +656,9 @@ export default class Client extends EventTarget {
|
|||
throw new Error("Failed to send IRC message " + msg.command + ": socket is closed");
|
||||
}
|
||||
this.ws.send(irc.formatMessage(msg));
|
||||
console.debug("Sent:", msg);
|
||||
if (this.debug) {
|
||||
console.debug("Sent:", msg);
|
||||
}
|
||||
}
|
||||
|
||||
setCaseMapping(name) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue