Skip to content

Commit 8ee95e3

Browse files
committed
Improve logging
1 parent e248950 commit 8ee95e3

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

github/table_github_commit.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ func tableGitHubCommitGet(ctx context.Context, d *plugin.QueryData, h *plugin.Hy
154154
var owner, repo string
155155
var sha string
156156

157-
logger := plugin.Logger(ctx)
158157
quals := d.KeyColumnQuals
159158

160159
if h.Item != nil {
@@ -175,7 +174,7 @@ func tableGitHubCommitGet(ctx context.Context, d *plugin.QueryData, h *plugin.Hy
175174
}
176175

177176
owner, repo = parseRepoFullName(fullName)
178-
logger.Trace("tableGitHubCommitGet", "owner", owner, "repo", repo, "sha", sha)
177+
plugin.Logger(ctx).Trace("tableGitHubCommitGet", "owner", owner, "repo", repo, "sha", sha)
179178
detail, _, err := client.Repositories.GetCommit(ctx, owner, repo, sha, opts)
180179

181180
return detail, err

github/table_github_pull_request.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,11 @@ func tableGitHubPullRequest() *plugin.Table {
8686
//// LIST FUNCTION
8787

8888
func tableGitHubPullRequestList(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) {
89-
logger := plugin.Logger(ctx)
9089
quals := d.KeyColumnQuals
9190

9291
fullName := quals["repository_full_name"].GetStringValue()
9392
owner, repo := parseRepoFullName(fullName)
94-
logger.Trace("tableGitHubPullRequestList", "owner", owner, "repo", repo)
93+
plugin.Logger(ctx).Trace("tableGitHubPullRequestList", "owner", owner, "repo", repo)
9594

9695
opt := &github.PullRequestListOptions{
9796
ListOptions: github.ListOptions{PerPage: 100},

github/utils.go

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ func getGitHubItem(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateDa
8080
getDetails := func(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) {
8181
client := connect(ctx, d)
8282

83+
plugin.Logger(ctx).Trace("Hydrating", "table", d.Table.Name, "quals", d.KeyColumnQuals, "fetchType", d.FetchType)
8384
return getDetailsFunc(ctx, d, h, client)
8485
}
8586

0 commit comments

Comments
 (0)