mirror of
https://codeberg.org/emersion/gamja.git
synced 2024-11-14 19:05:01 -05:00
lib/client: print raw messages in debug mode
Browser consoles aren't super helpful in general and just show the command name, require extra clicks to see the params.
This commit is contained in:
parent
038cc68ee4
commit
429b4595e7
1 changed files with 7 additions and 4 deletions
|
@ -287,11 +287,13 @@ export default class Client extends EventTarget {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let msg = irc.parseMessage(event.data);
|
let raw = event.data;
|
||||||
if (this.debug) {
|
if (this.debug) {
|
||||||
console.debug("Received:", msg);
|
console.debug("Received:", raw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let msg = irc.parseMessage(raw);
|
||||||
|
|
||||||
// If the prefix is missing, assume it's coming from the server on the
|
// If the prefix is missing, assume it's coming from the server on the
|
||||||
// other end of the connection
|
// other end of the connection
|
||||||
if (!msg.prefix) {
|
if (!msg.prefix) {
|
||||||
|
@ -708,9 +710,10 @@ export default class Client extends EventTarget {
|
||||||
if (!this.ws) {
|
if (!this.ws) {
|
||||||
throw new Error("Failed to send IRC message " + msg.command + ": socket is closed");
|
throw new Error("Failed to send IRC message " + msg.command + ": socket is closed");
|
||||||
}
|
}
|
||||||
this.ws.send(irc.formatMessage(msg));
|
let raw = irc.formatMessage(msg)
|
||||||
|
this.ws.send(raw);
|
||||||
if (this.debug) {
|
if (this.debug) {
|
||||||
console.debug("Sent:", msg);
|
console.debug("Sent:", raw);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue