Skip to content

Comments

Replace console.error with structured logging#73

Merged
Yaketh (Kushmanmb) merged 5 commits intomasterfrom
copilot/fix-console-error-issue
Feb 23, 2026
Merged

Replace console.error with structured logging#73
Yaketh (Kushmanmb) merged 5 commits intomasterfrom
copilot/fix-console-error-issue

Conversation

Copy link

Copilot AI commented Feb 23, 2026

Consolidates error logging to use the existing logger utility with Bugsnag integration and Datadog tracing instead of raw console.error calls scattered throughout the codebase.

Changes

  • Replaced 54 console.error instances with logger.error() across API routes, server components, client components, and utilities
  • Added ESLint enforcement: no-console rule (allows only warn/info) with explicit disables for logging infrastructure (logger.ts, bugsnag.ts, Errors.tsx)
  • Library code (libs/base-ui): Made console.error conditional on isDevelopment to avoid cross-package dependencies
  • Improved error handling: farcaster API route now returns 500 immediately when API_KEY is missing instead of logging and continuing

Example

Before:

} catch (error) {
  console.error('Registration error:', error);
  return NextResponse.json({ error: 'Internal server error' }, { status: 500 });
}

After:

} catch (error) {
  logger.error('Registration error', error);
  return NextResponse.json({ error: 'Internal server error' }, { status: 500 });
}

The logger provides structured logging with trace context, reports to Bugsnag in production, and maintains consistent error formatting across the application.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits February 23, 2026 13:37
Co-authored-by: Kushmanmb <193178375+Kushmanmb@users.noreply.github.com>
Co-authored-by: Kushmanmb <193178375+Kushmanmb@users.noreply.github.com>
Co-authored-by: Kushmanmb <193178375+Kushmanmb@users.noreply.github.com>
Co-authored-by: Kushmanmb <193178375+Kushmanmb@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix console.error handling in the application Replace console.error with structured logging Feb 23, 2026
@Kushmanmb Yaketh (Kushmanmb) marked this pull request as ready for review February 23, 2026 17:34
@Kushmanmb Yaketh (Kushmanmb) merged commit e3b5c6c into master Feb 23, 2026
8 of 12 checks passed
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bearer found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants