@@ -181,20 +181,17 @@ export function logger({
181
181
182
182
// Create hook functions.
183
183
function beforeExecute ( { state } : HookPayload < 'beforeExecute' > ) {
184
- const { client, commandQueue } = state ;
185
- log ( client , 'Starting execution' , {
184
+ log ( state . client , 'Starting execution' , {
186
185
commandString : state . context . commandString ,
187
- commandCount : commandQueue . length ,
186
+ commandCount : state . commandQueue . length ,
188
187
commands : state . commandQueue . map ( ( cmd ) => cmd . commandName ) . join ( ' → ' ) ,
189
188
} ) ;
190
189
}
191
190
function beforeCommand ( { state, data } : HookPayload < 'beforeCommand' > ) {
192
- const { command, client, params } = state ;
193
- if ( ! command ) return ;
194
- const { commandName } = command ;
195
- log ( client , 'Executing command' , {
196
- name : commandName ,
197
- params,
191
+ if ( ! state . command ) return ;
192
+ log ( state . client , 'Executing command' , {
193
+ name : state . command . commandName ,
194
+ params : state . params ,
198
195
data,
199
196
step : `${ state . i + 1 } /${ state . commandQueue . length } ` ,
200
197
} ) ;
0 commit comments