Skip to content

Commit

Permalink
Add details to log
Browse files Browse the repository at this point in the history
  • Loading branch information
Henrique Santos committed Sep 27, 2023
1 parent f8c9e4c commit 75472e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stackit/internal/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ func DiagsToError(diags diag.Diagnostics) error {

// LogAndAddError Logs the error and adds it to the diags
func LogAndAddError(ctx context.Context, diags *diag.Diagnostics, summary, detail string) {
tflog.Error(ctx, summary)
tflog.Error(ctx, fmt.Sprintf("%s | %s", summary, detail))
diags.AddError(summary, detail)
}

// LogAndAddWarning Logs the warning and adds it to the diags
func LogAndAddWarning(ctx context.Context, diags *diag.Diagnostics, summary, detail string) {
tflog.Warn(ctx, summary)
tflog.Warn(ctx, fmt.Sprintf("%s | %s", summary, detail))
diags.AddWarning(summary, detail)
}

0 comments on commit 75472e0

Please sign in to comment.