Skip to content

Conversation

@dkhalife
Copy link
Owner

@dkhalife dkhalife commented Jul 8, 2025

Summary

  • disable DB query logging unless in debug mode
  • add explicit warning when query logging is enabled
  • document log level config
  • restore README log level description

Testing

  • go test ./...

https://chatgpt.com/codex/tasks/task_e_686c847a921c832a889cc63a4e78f36a

Copilot AI review requested due to automatic review settings July 8, 2025 03:55
Copy link
Contributor

Copilot AI left a comment

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 changes database logging to only output SQL queries when the application is in debug mode, adds a warning when debug logging is enabled, and ensures a fallback warning level for unrecognized log levels.

  • Restricts GORM SQL logging to debug only
  • Emits a warning when SQL logging is enabled in debug mode
  • Adds a default case to map unknown log levels to Warn
Comments suppressed due to low confidence (2)

internal/utils/database/database.go:21

  • There isn't a unit test to verify that this warning is emitted when LogLevel is set to 'debug'; consider adding a test to cover this new behavior.
		logging.DefaultLogger().Warn("DEBUG level set: SQL queries will be logged and may contain sensitive data")

internal/utils/database/database.go:19

  • [nitpick] The 'info' level is no longer handled explicitly and will now fall through to the default warn level; review whether 'info' should still map to Info or update documentation to reflect this change.
	case "debug":

@codecov
Copy link

codecov bot commented Jul 8, 2025

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/utils/database/database.go 60.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@dkhalife dkhalife merged commit cdcf288 into main Jul 8, 2025
5 checks passed
@dkhalife dkhalife deleted the codex/update-logger-for-sensitive-sql-queries branch July 8, 2025 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants