Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 9, 2026

The logger was creating a new pino instance on every log call (buildBaseLogger() invoked in each function), causing unnecessary memory allocation and instantiation overhead.

Changes

  • Replace buildBaseLogger() function with module-scoped logger constant
  • Update all logging functions (loggyInfo, loggyDebug, loggyWarn, loggyTrace, loggyFatal, loggyError) to reference shared instance
  • Fix typo: "Recieved" → "Received" in loggyRequestReceived

Before:

const buildBaseLogger = () => {
  return pino({ /* config */ })
}

export const loggyInfo = (...) => {
  buildBaseLogger().info({ ... })  // New instance every call
}

After:

const logger = pino({ /* config */ })

export const loggyInfo = (...) => {
  logger.info({ ... })  // Reuse shared instance
}

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] WIP address feedback on extended logging Optimize logger by creating single pino instance at module scope Jan 9, 2026
Copilot AI requested a review from barluq January 9, 2026 12:04
@barluq barluq marked this pull request as ready for review January 9, 2026 12:08
@barluq barluq merged commit e485a09 into jan25-extended-validation Jan 9, 2026
@barluq barluq deleted the copilot/sub-pr-30 branch January 9, 2026 12:08
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