Skip to content

Commit 2c105ac

Browse files
chore: convert console.log to debug log in raqbUtils (calcom#27008)
## What does this PR do? Converts a `console.log` statement to use the proper `@calcom/lib/logger` with debug level in the raqbUtils.server.ts file. This ensures the log message only appears when debug logging is enabled, reducing noise in production logs. ## Mandatory Tasks (DO NOT REMOVE) - [x] I have self-reviewed the code (A decent size PR without self-review might be rejected). - [x] I have updated the developer docs in /docs if this PR makes changes that would require a [documentation change](https://cal.com/docs). N/A - no documentation changes needed. - [x] I confirm automated tests are in place that prove my fix is effective or that my feature works. N/A - logging change only. ## How should this be tested? This is a simple logging change. No specific testing required beyond CI passing. The log message "A group option found. Using all its sub-options instead" will now only appear when the logger level is set to debug (level 2 or lower via `NEXT_PUBLIC_LOGGER_LEVEL`). ## Checklist - [x] My code follows the style guidelines of this project - [x] I have checked if my changes generate no new warnings <!-- Link to Devin run: https://app.devin.ai/sessions/45d95cd7127541ffac96764f251ae1c9 --> <!-- Requested by: @hariombalhara -->
1 parent 1e0b0d9 commit 2c105ac

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/app-store/_utils/raqb/raqbUtils.server.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@ import type {
1414
AttributeOptionValue,
1515
} from "@calcom/app-store/routing-forms/types/types";
1616
import type { dynamicFieldValueOperands } from "@calcom/lib/raqb/types";
17+
import logger from "@calcom/lib/logger";
1718
import { caseInsensitive } from "@calcom/lib/raqb/utils";
1819
import { safeStringify } from "@calcom/lib/safeStringify";
1920
import { AttributeType } from "@calcom/prisma/enums";
2021

22+
const log = logger.getSubLogger({ prefix: ["raqbUtils"] });
23+
2124
function ensureArray(value: string | string[]) {
2225
return typeof value === "string" ? [value] : value;
2326
}
@@ -89,7 +92,7 @@ export function getValueOfAttributeOption(
8992
) {
9093
if (attributeOption.isGroup) {
9194
const subOptions = attributeOption.contains.map((option) => option.value);
92-
console.log("A group option found. Using all its sub-options instead", safeStringify(subOptions));
95+
log.debug("A group option found. Using all its sub-options instead", safeStringify(subOptions));
9396
return subOptions;
9497
}
9598
return attributeOption.value;

0 commit comments

Comments
 (0)