Skip to content

Improve configuration logging: show final resolved values and overrides #376

Description

@buenaflor

Problem

When using --sentry-define arguments alongside pubspec.yaml configuration, the current logging only shows:

info: Found config from pubspec.yaml

This is misleading because it doesn't indicate that --sentry-define values are also being used and taking precedence over the pubspec values.

Expected Behavior

The plugin should clearly log:

  1. Override notifications - When a --sentry-define argument overrides a value from pubspec.yaml or sentry.properties:

    info: 'release' overridden by --sentry-define: "1.0.0" (was: "0.9.0" from pubspec.yaml)
    
  2. Final resolved configuration - At debug level, show what values are actually being used:

    debug: Resolved configuration:
      - release: 1.0.0 (from --sentry-define)
      - project: my-project (from pubspec.yaml)
      - org: my-org (from environment variable)
      ...
    

Current Behavior

The merge logic in ConfigurationValues.merged() silently picks the highest-precedence value without any logging:

version: args.version ?? file.version,

Benefits

  • Easier debugging when configuration isn't working as expected
  • Clear visibility into which configuration sources are being used
  • Helps users understand the precedence order (env vars > args > file)

Implementation Notes

  • Override warnings could be logged at info level
  • Full resolved config could be logged at debug level to avoid noise
  • Should indicate the source of each value (--sentry-define, pubspec.yaml, sentry.properties, environment variable, default)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions