Skip to content

Commit ce81ce9

Browse files
committed
feat(client): add option --verbose
1 parent acccbdc commit ce81ce9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/cli/client.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ program
1717
defaultConfigFilepath,
1818
)
1919
.usage("[options] <path/to/config>")
20+
.option("-v, --verbose", "Log payload to stdout", false)
2021
.parse();
2122
const configFilepath = program.args[0] || defaultConfigFilepath;
23+
const opts = program.opts();
2224

2325
// Load and validate configuration.
2426
const ajv = new Ajv();
@@ -89,6 +91,13 @@ websocket.on("request", function (websocketNotification) {
8991
const name = chalk.green(localApp.name);
9092
const timestamp = new Date().toISOString();
9193
console.log(`${++requestIndex}. ${timestamp} [#${notificationId}] ${name}`);
94+
if (opts.verbose) {
95+
console.log(
96+
chalk.bgGray(
97+
"webhook payload: " + JSON.stringify(webhookPayload, null, 2),
98+
),
99+
);
100+
}
92101

93102
let qs = "";
94103
const queryKeys = webhookPayload.query && Object.keys(webhookPayload.query);

0 commit comments

Comments
 (0)