Skip to content

Commit

Permalink
add DEBUG_LOG_REQUESTS option
Browse files Browse the repository at this point in the history
  • Loading branch information
jwulf committed Sep 9, 2021
1 parent 6d2555a commit 365c15a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ docker build -t camunda-community-hub-probot .
docker run -e APP_ID=<app-id> -e PRIVATE_KEY=<pem-value> camunda-community-hub-probot
```

## Debugging Octokit
## Debug logging

Set the environment variable `OCTOKIT_DEBUG=TRUE` to turn on debug logging.
Set the environment variable `OCTOKIT_DEBUG=TRUE` to turn on debug logging for octokit.

Set `DEBUG_LOG_REQUESTS=TRUE` to log out all incoming webhook requests.

### Contributing

Expand Down
12 changes: 7 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@ module.exports = (app: Probot) => {
const zbc = require("./zeebe")(app);

app.log("Yay! The app was loaded!");

if ((process.env.OCTOKIT_DEBUG || 'false').toUpperCase() === 'TRUE') {
app.log.debug = console.debug;
}

app.webhooks.onAny(async (context) => {
console.log("onAny", {
event: context.name,
context: context,
});
if ((process.env.DEBUG_LOG_REQUESTS || 'false').toUpperCase() === 'TRUE') {
console.log("onAny", {
event: context.name,
context: context,
});
}
});

app.on([
Expand Down

0 comments on commit 365c15a

Please sign in to comment.