FaasJS
Home
  • Guide
  • Documents
  • Templates
  • Changelog
  • Ecosystem

    • Docker Images
  • Github
  • Contributing
  • Sponsor
  • Security
Home
  • Guide
  • Documents
  • Templates
  • Changelog
  • Ecosystem

    • Docker Images
  • Github
  • Contributing
  • Sponsor
  • Security

Documents / @faasjs/node-utils / getTransport

Function: getTransport()

getTransport(): Transport

Return the singleton transport used by Logger.

The instance is created lazily on first access and reused for the lifetime of the current process. Calling reset() clears state on that same instance.

Returns

Transport

Shared transport instance.

Example

import { getTransport, Logger } from '@faasjs/node-utils'

const transport = getTransport()

transport.register('console', async (messages) => {
  console.log(messages.length)
})

new Logger('app').info('hello')
await transport.flush()