Skip to content

Conversation

@sdseaton
Copy link
Contributor

This pull request refactors how logging is handled when generating script compare changes in the DatabaseChanges.cs file.

The main change is that scripts that produce 0 diffs are logged only in Debug instead of Information level; this removes a lot of noise from the logging output for entities that did not change.

Copilot AI review requested due to automatic review settings December 11, 2025 17:17
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 pull request refactors logging behavior for script comparison changes to reduce noise in log output. When generating database schema changes, entities that produce 0 diffs are now logged at Debug level instead of Information level, making the Information-level logs focus only on meaningful changes.

Key Changes:

  • Introduced LogChangeResult helper method to centralize logging logic
  • Dynamic log level selection: Information for changes with scripts, Debug for no-change scenarios
  • Added proper singular/plural handling for "script" vs "scripts" in log messages

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

var level = scriptCount > 0 ? LogLevel.Information : LogLevel.Debug;
var scriptsLabel = scriptCount == 1 ? "script" : "scripts";
var message = alreadyExists
? $"{entityKey} already exists, created {scriptCount} {scriptsLabel} to apply the diffs"
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

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

The two log messages have inconsistent punctuation. The "already exists" message (line 349) doesn't end with a period, while the "doesn't exist" message (line 350) ends with a period. For consistency, both messages should either have or not have a trailing period.

Suggested change
? $"{entityKey} already exists, created {scriptCount} {scriptsLabel} to apply the diffs"
? $"{entityKey} already exists, created {scriptCount} {scriptsLabel} to apply the diffs."

Copilot uses AI. Check for mistakes.
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