debug
Logs the current hook context to the console for debugging purposes. Displays timestamp, service path, method, type, id, data, query, result, and any additional param fields you specify.
ts
import { } from 'feathers-utils/hooks';Example
ts
import { debug } from 'feathers-utils/hooks'
app.service('users').hooks({
before: { find: [debug('before find', 'user')] }
})Type declaration
Show Type Declarations
ts
/**
* Logs the current hook context to the console for debugging purposes.
* Displays timestamp, service path, method, type, id, data, query, result, and
* any additional param fields you specify.
*
* @example
* ```ts
*
*
* app.service('users').hooks({
* before: { find: [debug('before find', 'user')] }
* })
* ```
*
* @see https://utils.feathersjs.com/hooks/debug.html
*/
export declare const debug: <H extends HookContext = HookContext>(
msg: string,
...fieldNames: string[]
) => (context: H, next?: NextFunction) => Promise<void>| Argument | Type | Description |
|---|---|---|
| msg | string | |
| fieldNames | string[] |
| type | methods | multi |
|---|---|---|
| before, after | all | yes |
