log
@rotorsoft/act-root / act/src / log
Variable: log
constlog: (adapter?) =>Logger|ConsoleLogger
Defined in: libs/act/src/ports.ts:136
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