Disabled console debug log Statements from the production build output

This commit is contained in:
Tola Leng
2025-07-15 17:36:12 +07:00
parent debf35703b
commit fd7035965f
7 changed files with 42 additions and 42 deletions
@@ -25,7 +25,7 @@ export function ServiceUptimeHistory({
const { data: uptimeHistory, isLoading, error } = useQuery({
queryKey: ['uptimeHistory', serviceId, serviceType, startDate?.toISOString(), endDate?.toISOString()],
queryFn: () => {
console.log(`ServiceUptimeHistory: Fetching for service ${serviceId} of type ${serviceType}`);
// console.log(`ServiceUptimeHistory: Fetching for service ${serviceId} of type ${serviceType}`);
return uptimeService.getUptimeHistory(serviceId, 200, startDate, endDate, serviceType);
},
enabled: !!serviceId && !!serviceType,
@@ -22,11 +22,11 @@ export function ServiceNotificationFields({ form }: ServiceNotificationFieldsPro
const notificationChannels = form.watch("notificationChannels") || [];
const alertTemplate = form.watch("alertTemplate");
console.log("Current notification values:", {
notificationStatus,
notificationChannels,
alertTemplate
});
// console.log("Current notification values:", {
// notificationStatus,
// notificationChannels,
// alertTemplate
// });
// Fetch alert configurations for notification channels
const { data: alertConfigsData } = useQuery({
@@ -42,16 +42,16 @@ export function ServiceNotificationFields({ form }: ServiceNotificationFieldsPro
setAlertConfigs(enabledChannels);
// Debug log to check what alert configs are loaded
console.log("Loaded alert configurations:", enabledChannels);
// console.log("Loaded alert configurations:", enabledChannels);
}
}, [alertConfigsData]);
// Log when form values change to debug
useEffect(() => {
console.log("Notification values changed:", {
notificationStatus: form.getValues("notificationStatus"),
notificationChannels: form.getValues("notificationChannels")
});
// console.log("Notification values changed:", {
// notificationStatus: form.getValues("notificationStatus"),
// notificationChannels: form.getValues("notificationChannels")
// });
}, [form.watch("notificationStatus"), form.watch("notificationChannels")]);
const handleChannelAdd = (channelId: string) => {
@@ -161,7 +161,7 @@ export function ServiceNotificationFields({ form }: ServiceNotificationFieldsPro
render={({ field }) => {
// Don't convert existing values to "default"
const displayValue = field.value || "default";
console.log("Rendering alert template field with value:", displayValue);
// console.log("Rendering alert template field with value:", displayValue);
return (
<FormItem>
@@ -39,7 +39,7 @@ export const ServiceRowActions = ({
try {
if (service.status === "paused") {
// Resume monitoring
console.log(`Resuming monitoring for service ${service.id} (${service.name}) from dropdown`);
// console.log(`Resuming monitoring for service ${service.id} (${service.name}) from dropdown`);
// First ensure we update the status
await serviceService.resumeMonitoring(service.id);
@@ -53,7 +53,7 @@ export const ServiceRowActions = ({
});
} else {
// Pause monitoring
console.log(`Pausing monitoring for service ${service.id} (${service.name}) from dropdown`);
// console.log(`Pausing monitoring for service ${service.id} (${service.name}) from dropdown`);
await serviceService.pauseMonitoring(service.id);
toast({
@@ -65,7 +65,7 @@ export const ServiceRowActions = ({
// Call the parent handler to refresh the UI
onPauseResume(service);
} catch (error) {
console.error("Error toggling monitoring:", error);
// console.error("Error toggling monitoring:", error);
toast({
variant: "destructive",
title: "Error",
@@ -83,10 +83,10 @@ export const ServiceRowActions = ({
if (onMuteAlerts) {
try {
console.log(`Attempting to ${alertsMuted ? 'unmute' : 'mute'} alerts for service ${service.id} (${service.name})`);
// console.log(`Attempting to ${alertsMuted ? 'unmute' : 'mute'} alerts for service ${service.id} (${service.name})`);
await onMuteAlerts(service);
} catch (error) {
console.error("Error toggling alerts:", error);
// console.error("Error toggling alerts:", error);
toast({
variant: "destructive",
title: "Error",