"use strict";
/**
 * Log Directory Configuration
 * Issue #11: Centralized LOG_DIR constant
 *
 * Eliminates duplicate LOG_DIR definitions previously found in:
 * - src/lib/log-manager.ts
 * - src/app/api/worktrees/[id]/logs/[filename]/route.ts
 *
 * Dependency chain: log-config.ts -> env.ts -> db-path-resolver.ts (no circular dependency)
 *
 * @module log-config
 */
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLogDir = getLogDir;
const path_1 = __importDefault(require("path"));
const env_1 = require("../lib/env");
/**
 * Get the log directory path.
 *
 * Resolution order:
 * 1. CM_LOG_DIR environment variable (with MCBD_LOG_DIR fallback via getEnvByKey)
 * 2. Default: `${process.cwd()}/data/logs`
 *
 * @returns Absolute path to the log directory
 *
 * @example
 * ```typescript
 * import { getLogDir } from '../config/log-config';
 *
 * const logDir = getLogDir();
 * // => '/path/to/project/data/logs' (default)
 * // => '/custom/log/dir' (when CM_LOG_DIR is set)
 * ```
 */
function getLogDir() {
    return (0, env_1.getEnvByKey)('CM_LOG_DIR') || path_1.default.join(process.cwd(), 'data', 'logs');
}
