Skip to content

@adrianhall/cloudflare-toolkit


@adrianhall/cloudflare-toolkit / index / createLogger

Function: createLogger()

createLogger(options): Logger

Defined in: src/lib/logging/logger.ts:161

Create a new Logger with the provided options.

  • options.transport is required.
  • options.level defaults to "info".
  • options.clock defaults to () => new Date().
  • options.bindings are merged into every emitted record.
  • options.onTransportError receives transport errors without crashing the app.

Parameters

options

CreateLoggerOptions

Logger construction options.

Returns

Logger

A new Logger.