mirror of
https://github.com/status-im/status-github-bot.git
synced 2025-02-28 04:40:45 +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",
|
"program": "${workspaceFolder}/node_modules/probot/bin/probot-run.js",
|
||||||
"args": [
|
"args": [
|
||||||
"${workspaceFolder}/index.js"
|
"${workspaceFolder}/index.js"
|
||||||
]
|
],
|
||||||
|
"env": {
|
||||||
|
"DEBUG": "true"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "node",
|
"type": "node",
|
||||||
|
8
index.js
8
index.js
@ -2,6 +2,14 @@ const Slack = require('./lib/slack')
|
|||||||
|
|
||||||
module.exports = async (robot) => {
|
module.exports = async (robot) => {
|
||||||
console.log('Yay, the app was loaded!')
|
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)
|
await setupSlack(robot)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user