import {
  getLogFn,
  getStopwatch
} from "./chunk-4RQGNE37.js";
import {
  findWorkspaceRoot
} from "./chunk-BDW32BZK.js";
import {
  require_source
} from "./chunk-GYCLBSTB.js";
import {
  LogLevel
} from "./chunk-PEPDFP2O.js";
import {
  __name,
  __toESM,
  init_esm_shims
} from "./chunk-BFNZYC5O.js";

// src/logger/create-logger.ts
init_esm_shims();
var import_chalk = __toESM(require_source(), 1);
async function createLogger(config) {
  const workspaceRoot = findWorkspaceRoot();
  if (!workspaceRoot) {
    throw new Error("Cannot find workspace root");
  }
  const writeFatal = getLogFn(LogLevel.FATAL, config, import_chalk.default);
  const writeError = getLogFn(LogLevel.ERROR, config, import_chalk.default);
  const writeWarning = getLogFn(LogLevel.WARN, config, import_chalk.default);
  const writeInfo = getLogFn(LogLevel.INFO, config, import_chalk.default);
  const writeSuccess = getLogFn(LogLevel.SUCCESS, config, import_chalk.default);
  const writeDebug = getLogFn(LogLevel.DEBUG, config, import_chalk.default);
  const writeTrace = getLogFn(LogLevel.DEBUG, config, import_chalk.default);
  return {
    fatal: writeFatal,
    error: writeError,
    warning: writeWarning,
    info: writeInfo,
    success: writeSuccess,
    debug: writeDebug,
    trace: writeTrace,
    getStopwatch
  };
}
__name(createLogger, "createLogger");

export {
  createLogger
};
