//#region src/preview/logger.ts
const LOG_LEVELS = {
	debug: 0,
	info: 1,
	warn: 2,
	error: 3,
	silent: 4
};
function getLogLevel() {
	if (typeof globalThis !== "undefined" && "EF_LOG_LEVEL" in globalThis) {
		const level = globalThis.EF_LOG_LEVEL;
		if (level && level in LOG_LEVELS) return level;
	}
	if (typeof process !== "undefined" && process.env?.EF_LOG_LEVEL) {
		const level = process.env.EF_LOG_LEVEL;
		if (level in LOG_LEVELS) return level;
	}
	return "silent";
}
function shouldLog(level) {
	const currentLevel = getLogLevel();
	return LOG_LEVELS[level] >= LOG_LEVELS[currentLevel];
}
const logger = {
	debug: (...args) => {
		if (shouldLog("debug")) console.log(...args);
	},
	info: (...args) => {
		if (shouldLog("info")) console.log(...args);
	},
	warn: (...args) => {
		if (shouldLog("warn")) console.warn(...args);
	},
	error: (...args) => {
		if (shouldLog("error")) console.error(...args);
	}
};

//#endregion
export { logger };
//# sourceMappingURL=logger.js.map