log
@rotorsoft/act-root / act/src / log
Variable: log
constlog: (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?
Optional logger implementation to inject
Returns
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
- Logger for the interface contract
- ConsoleLogger for the default implementation