Documentation
    Preparing search index...

    Exposes the API to construct targets array conditionally.

    Index

    Constructors

    Methods

    • Add target to the list of targets

      Parameters

      • value: TransportTargetOptions

        The transport target options to add

      Returns this

      The current Targets instance for chaining

    • Conditionally add target to the list targets. The target will only be added if the conditional is true.

      targets.if(process.env.NODE_ENV === 'development', {
      target: 'pino-pretty'
      })

      Parameters

      • conditional: boolean

        Condition to check before adding the target

      • value: TransportTargetOptions<Record<string, any>> | (() => TransportTargetOptions)

        The transport target options or factory function

      Returns this

      The current Targets instance for chaining

    • Conditionally add target to the list targets. The target will only be added unless the conditional is true.

      targets.unless(process.env.NODE_ENV === 'production', {
      target: 'pino-pretty'
      })

      Parameters

      • conditional: boolean

        Condition to check before adding the target

      • value: TransportTargetOptions<Record<string, any>> | (() => TransportTargetOptions)

        The transport target options or factory function

      Returns this

      The current Targets instance for chaining

    • Get targets array

      Returns TransportTargetOptions<Record<string, any>>[]

      Array of transport target options