mirror of
https://github.com/status-im/status-github-bot.git
synced 2025-02-27 20:30:37 +00:00
Log output to console if running attached to debugger
This commit is contained in:
parent
91c337ad49
commit
2869c23aa2
5
.vscode/launch.json
vendored
5
.vscode/launch.json
vendored
@ -22,7 +22,10 @@
|
||||
"program": "${workspaceFolder}/node_modules/probot/bin/probot-run.js",
|
||||
"args": [
|
||||
"${workspaceFolder}/index.js"
|
||||
]
|
||||
],
|
||||
"env": {
|
||||
"DEBUG": "true"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
|
8
index.js
8
index.js
@ -2,6 +2,14 @@ const Slack = require('./lib/slack')
|
||||
|
||||
module.exports = async (robot) => {
|
||||
console.log('Yay, the app was loaded!')
|
||||
if (process.env.DEBUG) {
|
||||
// HACK: If we're attached to the debugger, send output to console
|
||||
robot.log.error = console.log
|
||||
robot.log.warn = console.log
|
||||
robot.log.info = console.log
|
||||
robot.log.debug = console.log
|
||||
robot.log.trace = console.log
|
||||
}
|
||||
|
||||
await setupSlack(robot)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user