Skip to main content

@rtorcato/api-logger v1.0.0

Interfaces

CreateLoggerOptions

Defined in: index.ts:4

Extends

  • LoggerOptions

Properties

pretty?

optional pretty?: boolean

Defined in: index.ts:10

Pretty-print human-readable logs via pino-pretty. Defaults to true when NODE_ENV !== 'production'. Requires pino-pretty to be installed (optional peer dependency).

Functions

createLogger()

createLogger(options?, destination?): Logger

Defined in: index.ts:23

Create a configured pino logger.

Framework-agnostic — wrap it for Hono/Express in a dedicated adapter package. Level defaults to LOG_LEVEL env var, then info.

Parameters

options?

CreateLoggerOptions = {}

pino options plus a pretty toggle.

destination?

DestinationStream

optional pino destination stream; when supplied it wins over the pretty transport (useful for tests and custom sinks).

Returns

Logger