Structured logging with Pino for this project. Environment-aware configuration, context-based child loggers, ILogger adapter for compatibility. Triggers on "logging", "logger", "createLogger", "pino", "structured logging".
Project uses Pino for structured logging with environment detection (Lambda/Azure/dev/test).
Create child loggers per module:
// From functions/lib/logger.ts
import { createLogger } from "../lib/logger";
const log = createLogger("digest-processor");
Each context gets own child logger with context field. All logs tagged automatically.
Auto-detects platform from env vars:
// From functions/lib/logger.ts
const isLambda = !!process.env.AWS_LAMBDA_FUNCTION_NAME;
const isAzure = !!process.env.AZURE_FUNCTIONS_ENVIRONMENT;
const isDev = process.env.NODE_ENV === "development";
const isTest = process.env.NODE_ENV === "test";
Behavior per environment:
level: "silent")pino-pretty)Only use pino-pretty in dev, not Lambda/Azure/test:
// From functions/lib/logger.ts