File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff 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 ( ) ;
2122const configFilepath = program . args [ 0 ] || defaultConfigFilepath ;
23+ const opts = program . opts ( ) ;
2224
2325// Load and validate configuration.
2426const 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 ) ;
You can’t perform that action at this time.
0 commit comments