Skip to content

maint: migrate data sources to tflog structured logging#3346

Open
feyzsari wants to merge 1 commit intointegrations:mainfrom
feyzsari:maint/migrate-tflog-data-sources
Open

maint: migrate data sources to tflog structured logging#3346
feyzsari wants to merge 1 commit intointegrations:mainfrom
feyzsari:maint/migrate-tflog-data-sources

Conversation

@feyzsari
Copy link
Copy Markdown

Resolves #2629


Before the change?

data_source_github_actions_organization_registration_token, data_source_github_actions_registration_token,
and data_source_github_branch used the standard log package with log.Printf("[DEBUG] ..."),
embedding values directly in the message string.

After the change?

Replaced log imports with github.com/hashicorp/terraform-plugin-log/tflog.
Log calls now use tflog.Debug(ctx, "...", map[string]any{...}) with structured fields,
providing proper integration with Terraform's logging system (TF_LOG, TF_LOG_PROVIDER)
and enabling field-based log filtering.

Pull request checklist

  • Schema migrations have been created if needed (example)
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

Replace standard log.Printf calls with tflog.Debug using structured
fields in the following data sources:
- data_source_github_actions_organization_registration_token
- data_source_github_actions_registration_token
- data_source_github_branch

Part of integrations#2629
@github-actions
Copy link
Copy Markdown

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@github-actions github-actions Bot added the Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR label Apr 17, 2026
Copy link
Copy Markdown
Collaborator

@deiga deiga left a comment

Choose a reason for hiding this comment

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

Sweet! Thanks!🙏

@deiga
Copy link
Copy Markdown
Collaborator

deiga commented Apr 18, 2026

Please remove the resolves comment, since it adresses the issue only partly. And "resolves" will close the issue

@deiga deiga added this to the v6.13.0 Release milestone Apr 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT]: Switch logging to the tflog package to enable targeted log-level configuration

2 participants