Skip to main content

log

@rotorsoft/act-root


@rotorsoft/act-root / act/src / log

Variable: log

const log: (adapter?) => Logger | ConsoleLogger

Defined in: libs/act/src/ports.ts:122

Gets or injects the singleton logger.

By default, Act uses a built-in ConsoleLogger that emits JSON lines in production (compatible with GCP, AWS CloudWatch, Datadog) and colorized output in development — zero external dependencies.

For pino, inject a PinoLogger from @rotorsoft/act-pino before building your application.

Parameters

adapter?

Logger | ConsoleLogger

Optional logger implementation to inject

Returns

Logger | ConsoleLogger

The singleton logger instance

Examples

import { log } from "@rotorsoft/act";
const logger = log();
logger.info("Application started");
import { log } from "@rotorsoft/act";
import { PinoLogger } from "@rotorsoft/act-pino";
log(new PinoLogger({ level: "debug", pretty: true }));

See