Interface: LifecycleHookEvent
Defined in: src/utils/lifecycle.ts:143
What onHook receives after each hook ran or was undone.
Example
ts
await startLifecycle(app, {
onHook: ({ key, action, ms, error }: LifecycleHookEvent) =>
logger.info({ key, action, ms, failed: error !== undefined }),
});Properties
action
readonlyaction:"start"|"undo"
Defined in: src/utils/lifecycle.ts:149
start: the hook ran (at startup); undo: its undo function ran (at stop or rollback).
error?
readonlyoptionalerror?:unknown
Defined in: src/utils/lifecycle.ts:153
Why it failed or didn't finish; missing when it succeeded.
key
readonlykey:ServiceKey
Defined in: src/utils/lifecycle.ts:145
The hook's key, e.g. 'Payments.consumer:start'.
ms
readonlyms:number
Defined in: src/utils/lifecycle.ts:151
How long it took, in milliseconds.
stage
readonlystage:string
Defined in: src/utils/lifecycle.ts:147
The hook's stage.