Skip to content

Commit

Permalink
Merge pull request #242 from aternosorg/logging
Browse files Browse the repository at this point in the history
Add google cloud logging
  • Loading branch information
JulianVennen authored Apr 13, 2021
2 parents ad8d2be + 9ac840b commit 9acd26a
Show file tree
Hide file tree
Showing 33 changed files with 1,838 additions and 224 deletions.
11 changes: 10 additions & 1 deletion example.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
9 changes: 8 additions & 1 deletion index.js
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)
});
Loading

0 comments on commit 9acd26a

Please sign in to comment.