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
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()