-
Notifications
You must be signed in to change notification settings - Fork 0
chore: console.* → logger + override no-console em CLI/tests (Onda 1 PR 1.4) #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,9 @@ | ||
| import { useEffect, useRef } from "react"; | ||
| import { supabase } from "@/integrations/supabase/client"; | ||
| import { invalidateWhatsAppModeCache } from "@/lib/whatsappAdapter"; | ||
| import { getLogger } from '@/lib/logger'; | ||
|
|
||
| const log = getLogger('IntegrationMigration'); | ||
|
|
||
| /** | ||
| * Roda `rpc_migrate_whatsapp_integration` uma vez por sessão. | ||
|
|
@@ -31,7 +34,7 @@ export function IntegrationMigrationMount() { | |
| sessionStorage.setItem(SESSION_KEY, "1"); | ||
| invalidateWhatsAppModeCache(); | ||
| if (import.meta.env.DEV) { | ||
| console.info("[integration-migration] result:", data); | ||
| log.info("result:", data); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
| } catch (e) { | ||
| console.warn("[integration-migration] error:", e); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -206,7 +206,7 @@ export const safeClient = { | |
| } | ||
| }); | ||
| } catch (err) { | ||
| console.warn('[safeClient] Erro ao sincronizar estado de saúde', err); | ||
| _log.warn('Erro ao sincronizar estado de saúde', err); | ||
| } | ||
| }, | ||
|
|
||
|
|
@@ -218,11 +218,11 @@ export const safeClient = { | |
| const maskedDetail = this.maskSensitiveData(detail); | ||
|
|
||
| if (level === 'error') { | ||
| console.error(prefix, message, maskedDetail || ''); | ||
| _log.error(`${prefix} ${message}`, maskedDetail || ''); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When Useful? React with 👍 / 👎. |
||
| } else if (level === 'warn') { | ||
| console.warn(prefix, message, maskedDetail || ''); | ||
| _log.warn(`${prefix} ${message}`, maskedDetail || ''); | ||
| } else { | ||
| console.info(prefix, message, maskedDetail || ''); | ||
| _log.info(`${prefix} ${message}`, maskedDetail || ''); | ||
|
vercel[bot] marked this conversation as resolved.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
| }, | ||
|
|
||
|
|
@@ -313,7 +313,7 @@ export const safeClient = { | |
| }); | ||
| } catch (dbErr) { | ||
| // Ignorar erros de persistência para não travar a operação principal | ||
| console.warn('[safeClient] Falha ao persistir log de saúde', dbErr); | ||
| _log.warn('Falha ao persistir log de saúde', dbErr); | ||
| } | ||
| }, | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Direct console.warn() calls used instead of logger instance, inconsistent with logger usage pattern