MCPcopy Create free account
hub / github.com/fastify/fastify / constructor

Method constructor

lib/log-controller.js:21–26  ·  view source on GitHub ↗

* @param {object} [options] * @param {boolean | ((req: object) => boolean)} [options.disableRequestLogging=false] * When `true` (or a function returning `true`), per-request log lines * (incoming, completed, errors) are suppressed. * @param {string} [options.requestIdLogLabel='reqId'

(options)

Source from the content-addressed store, hash-verified

19 * The label used for the request identifier when logging the request.
20 */
21 constructor (options) {
22 const opts = options || {}
23 this.disableRequestLogging = opts.disableRequestLogging || defaultInitOptions.disableRequestLogging
24 this.isDisableRequestLoggingFunction = typeof this.disableRequestLogging === 'function'
25 this.requestIdLogLabel = opts.requestIdLogLabel || defaultInitOptions.requestIdLogLabel
26 }
27
28 /**
29 * Checks whether request logging is disabled for the given request.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected