Skip to content

pino logger impl.#5

Merged
nandan-varma merged 1 commit into
mainfrom
logger
Oct 8, 2025
Merged

pino logger impl.#5
nandan-varma merged 1 commit into
mainfrom
logger

Conversation

@nandan-varma

Copy link
Copy Markdown
Owner

basic pino logger implementation
#4

@nandan-varma nandan-varma requested a review from Copilot October 7, 2025 22:05
@vercel

vercel Bot commented Oct 7, 2025

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
friday Ready Ready Preview Comment Oct 7, 2025 10:06pm

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a structured logging solution using Pino logger to replace console logging throughout the application. The change introduces consistent error logging and improves observability by using structured JSON logging with proper error handling.

Key changes:

  • Replaced console.error, console.warn, and console.log statements with Pino logger calls
  • Added consistent error object structure with { err: error } pattern
  • Updated AI service to use more cost-effective model (gpt-4o-mini)

Reviewed Changes

Copilot reviewed 20 out of 22 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/lib/logger.ts New Pino logger configuration with development pretty printing
package.json Added pino and pino-pretty dependencies
next.config.mjs Added pino packages to external packages list for proper bundling
src/lib/services/*.ts Replaced console logging with structured logger calls
src/lib/actions.ts Updated server actions to use logger instead of console
src/app/api/*.ts Updated API routes to use structured logging
middleware.ts Added logger import and updated error logging
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 83 to +84
const { object } = await generateObject({
model: openai("gpt-4-turbo"),
model: openai("gpt-4o-mini"),

Copilot AI Oct 7, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] The model change from 'gpt-4-turbo' to 'gpt-4o-mini' reduces costs but may impact accuracy for complex natural language event parsing. Consider documenting this trade-off or making it configurable via environment variables.

Copilot uses AI. Check for mistakes.
Comment on lines 5 to +6
const result = await generateText({
model: openai("gpt-4"),
model: openai("gpt-4o-mini"),

Copilot AI Oct 7, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] Similar model downgrade from 'gpt-4' to 'gpt-4o-mini' may affect AI response quality. Consider making the model selection configurable through environment variables to allow different models for different environments.

Copilot uses AI. Check for mistakes.
Comment thread src/app/api/chat/route.ts

const result = streamText({
model: openai("gpt-4o"),
model: openai("gpt-4o-mini"),

Copilot AI Oct 7, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] The chat API model downgrade from 'gpt-4o' to 'gpt-4o-mini' could reduce conversation quality and context understanding. For user-facing chat features, consider keeping the more capable model or making this configurable.

Copilot uses AI. Check for mistakes.
@nandan-varma nandan-varma merged commit 0d76c9e into main Oct 8, 2025
2 of 4 checks passed
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