Disable verbose logging

- Disable log console output in file to prevent logs from being printed to the console.
This commit is contained in:
Tola Leng
2025-07-31 14:57:16 +07:00
parent 205bedfba5
commit 8bb78e68ea
5 changed files with 16 additions and 16 deletions
@@ -114,7 +114,7 @@ export const AddRegionalAgentDialog: React.FC<AddRegionalAgentDialogProps> = ({
textarea.setSelectionRange(0, 99999); // For mobile devices
}
} catch (selectError) {
console.error('Failed to select text:', selectError);
// console.error('Failed to select text:', selectError);
}
}
};
@@ -64,18 +64,18 @@ sudo -E bash ./server-docker-agent.sh`;
const handleCopyOneClickCommand = async (e: React.MouseEvent) => {
e.preventDefault();
e.stopPropagation();
console.log('Copy one-click command button clicked');
// console.log('Copy one-click command button clicked');
const command = getDockerOneClickCommand();
console.log('Copying one-click command:', command);
// console.log('Copying one-click command:', command);
await copyToClipboard(command);
};
const handleCopyDockerCommand = async (e: React.MouseEvent) => {
e.preventDefault();
e.stopPropagation();
console.log('Copy docker command button clicked');
// console.log('Copy docker command button clicked');
const command = getDirectDockerCommand();
console.log('Copying docker command:', command);
// console.log('Copying docker command:', command);
await copyToClipboard(command);
};
@@ -125,7 +125,7 @@ export const useServiceData = (serviceId: string | undefined, startDate: Date, e
} else {
// Fetch regional agent specific data
const [regionName, agentId] = currentAgent.split("|");
console.log(`Fetching regional agent data for region: ${regionName}, agent: ${agentId} from ${service.type} collection`);
// console.log(`Fetching regional agent data for region: ${regionName}, agent: ${agentId} from ${service.type} collection`);
history = await uptimeService.getUptimeHistoryByRegionalAgent(serviceId, limit, start, end, service.type, regionName, agentId);
// console.log(`Retrieved ${history.length} regional monitoring records`);
}
@@ -38,7 +38,7 @@ export const addSSLCertificate = async (
return record as unknown as SSLCertificate;
} catch (error) {
console.error("Error adding SSL certificate:", error);
// console.error("Error adding SSL certificate:", error);
throw error;
}
};
@@ -67,7 +67,7 @@ export const checkAndUpdateCertificate = async (
// Return the current certificate data
return typedCertificate;
} catch (error) {
console.error("Error updating SSL certificate:", error);
// console.error("Error updating SSL certificate:", error);
throw error;
}
};
@@ -84,10 +84,10 @@ export const triggerImmediateCheck = async (certificateId: string): Promise<void
check_at: currentTime
});
console.log(`Triggered immediate check for certificate ${certificateId} at ${currentTime}`);
// console.log(`Triggered immediate check for certificate ${certificateId} at ${currentTime}`);
toast.success("SSL check scheduled - certificate will be checked shortly");
} catch (error) {
console.error("Error triggering immediate SSL check:", error);
// console.error("Error triggering immediate SSL check:", error);
toast.error("Failed to schedule SSL check");
throw error;
}
@@ -101,7 +101,7 @@ export const deleteSSLCertificate = async (id: string): Promise<boolean> => {
await pb.collection("ssl_certificates").delete(id);
return true;
} catch (error) {
console.error("Error deleting SSL certificate:", error);
// console.error("Error deleting SSL certificate:", error);
throw error;
}
};
+5 -5
View File
@@ -2,12 +2,12 @@
import { toast } from "@/hooks/use-toast";
export const copyToClipboard = async (text: string) => {
console.log('copyToClipboard called with text:', text); // Debug log
// console.log('copyToClipboard called with text:', text); // Debug log
try {
// Try modern clipboard API first
if (navigator.clipboard && window.isSecureContext) {
console.log('Using modern clipboard API'); // Debug log
// console.log('Using modern clipboard API'); // Debug log
await navigator.clipboard.writeText(text);
toast({
title: "Copied!",
@@ -16,7 +16,7 @@ export const copyToClipboard = async (text: string) => {
return;
}
console.log('Using fallback clipboard method'); // Debug log
// console.log('Using fallback clipboard method'); // Debug log
// Fallback for older browsers or non-secure contexts
const textArea = document.createElement("textarea");
@@ -39,7 +39,7 @@ export const copyToClipboard = async (text: string) => {
document.body.removeChild(textArea);
if (successful) {
console.log('Copy successful with execCommand'); // Debug log
// console.log('Copy successful with execCommand'); // Debug log
toast({
title: "Copied!",
description: "Content copied to clipboard successfully.",
@@ -48,7 +48,7 @@ export const copyToClipboard = async (text: string) => {
throw new Error('Copy command failed');
}
} catch (error) {
console.error('Failed to copy to clipboard:', error);
// console.error('Failed to copy to clipboard:', error);
// Show error toast
toast({