Skip to content

Commit

Permalink
Log message fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
traut committed Jan 5, 2025
1 parent 200c56c commit 778ca07
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions internal/github/publish_github_gist.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func publishGithubGist(loader ClientLoaderFn) plugin.PublishFunc {
if document == nil {
return diagnostics.Diag{{
Severity: hcl.DiagError,
Summary: "Failed to parse document",
Summary: "Failed to parse the document",
Detail: "document is required",
}}
}
Expand Down Expand Up @@ -137,7 +137,7 @@ func publishGithubGist(loader ClientLoaderFn) plugin.PublishFunc {
if !descriptionAttr.IsNull() && descriptionAttr.AsString() != "" {
payload.Description = gh.String(descriptionAttr.AsString())
}
slog.InfoContext(ctx, "Publish to github gist", "filename", fileName)
slog.InfoContext(ctx, "Publishing to GitHub gist", "filename", fileName)
gistId := params.Args.GetAttrVal("gist_id")
if gistId.IsNull() || gistId.AsString() == "" {
slog.DebugContext(ctx, "No gist id set, creating a new gist", "is_public", payload.Public, "files", len(payload.Files))
Expand All @@ -149,14 +149,14 @@ func publishGithubGist(loader ClientLoaderFn) plugin.PublishFunc {
Detail: err.Error(),
}}
}
slog.InfoContext(ctx, "Created gist", "url", *gist.HTMLURL)
slog.InfoContext(ctx, "Created the gist", "url", *gist.HTMLURL)
} else {
slog.DebugContext(ctx, "Fetching the gist", "gist_id", gistId.AsString())
gist, _, err := client.Gists().Get(ctx, gistId.AsString())
if err != nil {
return diagnostics.Diag{{
Severity: hcl.DiagError,
Summary: "Failed to retreive gist",
Summary: "Failed to retreive the gist",
Detail: err.Error(),
}}
}
Expand All @@ -173,11 +173,11 @@ func publishGithubGist(loader ClientLoaderFn) plugin.PublishFunc {
if err != nil {
return diagnostics.Diag{{
Severity: hcl.DiagError,
Summary: "Failed to update gist",
Summary: "Failed to update the gist",
Detail: err.Error(),
}}
}
slog.InfoContext(ctx, "Updated gist", "url", *gist.HTMLURL)
slog.InfoContext(ctx, "The gist updated successfully", "url", *gist.HTMLURL)
}
return nil
}
Expand Down

0 comments on commit 778ca07

Please sign in to comment.