@@ -252,15 +252,15 @@ export class IndexGeneratorSource {
252
252
}
253
253
254
254
/**
255
- * Create a log action for tracking file generation progress
255
+ * Displays the log message after generating the index file
256
256
*
257
257
* @example
258
- * const action = this.#createLogAction ()
258
+ * const startTime = process.hrtime ()
259
259
* // ... perform operations
260
- * action.displayDuration().succeeded( )
260
+ * this.#logCreation(startTime )
261
261
*/
262
- #createLogAction ( ) {
263
- return this . #cliLogger. action ( `create ${ this . #config. output } `)
262
+ #logCreation ( startTime : [ number , number ] ) {
263
+ this . #cliLogger. info ( `created ${ this . #config. output } `, { startTime } )
264
264
}
265
265
266
266
/**
@@ -275,9 +275,9 @@ export class IndexGeneratorSource {
275
275
const added = this . #vfs. add ( filePath )
276
276
if ( added ) {
277
277
debug ( 'file added, re-generating "%s" index' , this . name )
278
- const action = this . #createLogAction ( )
278
+ const startTime = process . hrtime ( )
279
279
await this . #generateOutput( )
280
- action . displayDuration ( ) . succeeded ( )
280
+ this . #logCreation ( startTime )
281
281
}
282
282
}
283
283
@@ -293,9 +293,9 @@ export class IndexGeneratorSource {
293
293
const removed = this . #vfs. remove ( filePath )
294
294
if ( removed ) {
295
295
debug ( 'file removed, re-generating "%s" index' , this . name )
296
- const action = this . #createLogAction ( )
296
+ const startTime = process . hrtime ( )
297
297
await this . #generateOutput( )
298
- action . displayDuration ( ) . succeeded ( )
298
+ this . #logCreation ( startTime )
299
299
}
300
300
}
301
301
@@ -306,9 +306,9 @@ export class IndexGeneratorSource {
306
306
* the configuration, and writes the generated index file to disk.
307
307
*/
308
308
async generate ( ) {
309
- const action = this . #createLogAction ( )
309
+ const startTime = process . hrtime ( )
310
310
await this . #vfs. scan ( )
311
311
await this . #generateOutput( )
312
- action . displayDuration ( ) . succeeded ( )
312
+ this . #logCreation ( startTime )
313
313
}
314
314
}
0 commit comments