const ENABLE_LOGGING = process.env.ENABLE_LOGGING === "true" || process.env.ENABLE_LOGGING === "1";
export function log(type = "info", ...args) {
    if (!ENABLE_LOGGING)
        return;
    switch (type) {
        case "info":
            console.info(...args);
            break;
        case "error":
            console.error(...args);
            break;
        default:
            console.log(...args);
    }
}
export function parseSchemaPermissions(permissionsString) {
    const permissions = {};
    if (!permissionsString) {
        return permissions;
    }
    const permissionPairs = permissionsString.split(",");
    for (const pair of permissionPairs) {
        const [schema, value] = pair.split(":");
        if (schema && value) {
            permissions[schema.trim()] = value.trim() === "true";
        }
    }
    return permissions;
}
