@repo/logger provides structured logging for the monorepo. It defines a BaseLogger abstraction and concrete implementations: ConsoleLogger, StructuredLogger (JSON output), and NextJSLogger. Each logger supports info, warn, error, and debug, plus .child() for scoped loggers. Imports use subpaths: @repo/logger/base, @repo/logger/console, @repo/logger/nextjs, and @repo/logger/structured.
graph TD
logger["@repo/logger"]
logger -.-> tsconfig["@repo/typescript-config"]
logger -.-> vitest["@repo/vitest-config"]import { ConsoleLogger } from "@repo/logger/console";
const logger = new ConsoleLogger({ name: "my-service" });
logger.info("Processing request", { requestId: "abc-123" });
const childLogger = logger.child({ name: "my-service:sub-task" });
childLogger.debug("Sub-task started");
| Script | Description |
|---|---|
lint |
Runs Biome check on the package. |
test |
Runs Vitest with coverage. |
test:watch |
Runs Vitest in watch mode. |
check-types |
Runs tsc --noEmit to typecheck the package. |