Various error log improvements #100
1 changed files with 8 additions and 8 deletions
Make discord client log disconnections and errors outside CONNECTION_DEBUG
These logs are useful in production environments, when investigating unexpected downtime and incidents.
commit
2a34e797c3
|
|
@ -62,7 +62,6 @@ class DiscordClient {
|
|||
})
|
||||
}
|
||||
|
||||
if (CONNECTION_DEBUG) {
|
||||
const addEventLogger = (eventName, logName) => {
|
||||
this.cloud.on(eventName, (...args) => {
|
||||
const d = new Date().toISOString().slice(0, 19)
|
||||
|
|
@ -71,6 +70,7 @@ class DiscordClient {
|
|||
}
|
||||
addEventLogger("error", "Error")
|
||||
addEventLogger("disconnected", "Disconnected")
|
||||
|
|
||||
if (CONNECTION_DEBUG) {
|
||||
addEventLogger("ready", "Ready")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue
I don't want to move these outside of the CONNECTION_DEBUG filter because printing "disconnected" and not printing anything after it comes back online makes the situation look bad when there was actually no issue.
If there are actually any connection reliability issues in Cloudstorm (which I think we've dealt with, because I haven't seen any in many months) then more logging is needed to diagnose those anyway.