import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
import path from "path";
//#region src/utils/logger/config.ts
/**
* Logger Configuration
* Centralized configuration loading from environment variables
*/
/**
* Load configuration from environment variables
*/
function loadConfig() {
	const config = { ...DEFAULT_CONFIG };
	const logLevel = process.env.XOPC_LOG_LEVEL || process.env.LOG_LEVEL;
	if (logLevel) config.level = logLevel.toLowerCase();
	else if (process.env.DEBUG) config.level = "debug";
	if (process.env.XOPC_LOG_DIR) config.logDir = process.env.XOPC_LOG_DIR;
	if (process.env.XOPC_LOG_CONSOLE === "false") config.consoleOutput = false;
	if (process.env.XOPC_LOG_FILE === "false") config.fileOutput = false;
	if (process.env.XOPC_LOG_RETENTION_DAYS) config.retentionDays = parseInt(process.env.XOPC_LOG_RETENTION_DAYS, 10);
	if (process.env.XOPC_PRETTY_LOGS === "true") config.prettyPrint = true;
	return config;
}
/**
* Get current log directory
*/
function getLogDir() {
	return config.logDir;
}
/**
* Get logger configuration
*/
function getLoggerConfig() {
	return { ...config };
}
var DEFAULT_CONFIG, config;
var init_config = __esmMin((() => {
	DEFAULT_CONFIG = {
		level: "info",
		logDir: path.join(process.env.HOME || ".", ".xopc", "logs"),
		consoleOutput: true,
		fileOutput: true,
		errorFileOutput: true,
		retentionDays: 7,
		maxFileSizeMB: 100,
		prettyPrint: false,
		async: true,
		debugSampleRate: 1
	};
	config = loadConfig();
}));
//#endregion
init_config();
export { config, getLogDir, getLoggerConfig, init_config, loadConfig };

//# sourceMappingURL=config.js.map