import {
  getLogFn,
  getStopwatch
} from "./chunk-LHYMHJN7.js";
import {
  findWorkspaceRoot
} from "./chunk-2F7SMIKE.js";
import {
  require_source
} from "./chunk-F5YSYO5J.js";
import {
  LogLevel
} from "./chunk-WN4V6QSX.js";
import {
  __name,
  __toESM,
  init_esm_shims
} from "./chunk-65NJ2BNV.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
};
