Skip to content

Function: logger()

logger(loggerName): Logger

Build a tagged logger for a plugin or module.

The tag is [name] when loggerName is a non-empty string, a NameLike with name, or a file / URL path (the basename without extension is used). Consola applies the tag via withTag (render-time). The console fallbacks prepend LEVEL [name] on Node/Bun hosts or [name] alone in browsers via createFormatter.

Calls below process.env.LOG_LEVEL are dropped by shouldEmit before the sink formats or writes the line.

string | NameLike | undefined

Logger

import { log } from "@dbx-tools/shared-core";
const logger = log.logger("genie/chat");
logger.info("starting");
logger.warn("missing optional config", { reason: "no env var" });