feat(abacatepay): enhance environment variable logging
Replace simple debug log with comprehensive logging of environment variables, including NODE_ENV, API key (masked), webhook secret, and base URL, to improve debugging and visibility in both development and production environments.
This commit is contained in:
1 parent
634a5bc40b
commit
ad62dd0de2
1 file changed
+25
-6
+25
-6
@@ -177,12 +177,31 @@ const apiKey = isProduction
|
||||
? process.env.ABACATE_APIKEY || "demo_key"
|
||||
: process.env.ABACATE_TEST_APIKEY || "demo_key";
|
||||
|
||||
// Log para debug (apenas em desenvolvimento)
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
console.log(
|
||||
`🔧 AbacatePay: Using ${isProduction ? "PRODUCTION" : "TEST"} environment`
|
||||
);
|
||||
}
|
||||
// Log completo das variáveis de ambiente configuradas
|
||||
console.log("\n🔧 ==========================================");
|
||||
console.log("🔧 VARIÁVEIS DE AMBIENTE DO ABACATEPAY");
|
||||
console.log("🔧 ==========================================");
|
||||
console.log(`📊 NODE_ENV: ${process.env.NODE_ENV || "não definido"}`);
|
||||
console.log(`📊 Environment: ${isProduction ? "PRODUCTION" : "TEST"}`);
|
||||
console.log(
|
||||
`📊 API Key: ${apiKey ? "✅ Configurada (masqueada)" : "❌ NÃO CONFIGURADA"}`
|
||||
);
|
||||
console.log(
|
||||
`📊 API Key preview: ${
|
||||
apiKey ? apiKey.substring(0, 10) + "..." : "não definida"
|
||||
}`
|
||||
);
|
||||
console.log(
|
||||
`📊 Webhook Secret: ${
|
||||
process.env.ABACATEPAY_WEBHOOK_SECRET
|
||||
? "✅ Configurada"
|
||||
: "❌ NÃO CONFIGURADA"
|
||||
}`
|
||||
);
|
||||
console.log(
|
||||
`📊 Base URL: ${process.env.NEXT_PUBLIC_BASE_URL || "não definido"}`
|
||||
);
|
||||
console.log("🔧 ==========================================\n");
|
||||
|
||||
export const abacatePay = new AbacatePayClient({
|
||||
apiKey,
|
||||
|
||||
Reference in new issue
Block a user