-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #242 from aternosorg/logging
Add google cloud logging
- Loading branch information
Showing
33 changed files
with
1,838 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,14 @@ | |
"bigNumberStrings": true | ||
}, | ||
"prefix": "!", | ||
"googleapikey":"google API Key" | ||
"googleapikey":"google API Key", | ||
"monitoring": { | ||
"enabeled": false, | ||
"project_id": "000", | ||
"log_name": "modbot", | ||
"credentials": { | ||
"client_email": "[email protected]", | ||
"private_key": "google service account private key" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
const Bot = require("./src/Bot"); | ||
const Monitor = require("./src/Monitor"); | ||
|
||
Bot.getInstance().start().catch((error) => { | ||
Bot.getInstance().start().catch(async (error) => { | ||
try { | ||
await Monitor.getInstance().emergency('Bot crashed', error); | ||
} | ||
catch (e) { | ||
console.error('Failed to send fatal error to monitoring'); | ||
} | ||
console.error(error); | ||
process.exit(1) | ||
}); |
Oops, something went wrong.