From 6d35b89a96fb8bfcc1a2c6ac4d0b236ce05b6fd4 Mon Sep 17 00:00:00 2001 From: Jacob Valdemar Andreasen Date: Fri, 14 Aug 2020 14:49:11 +0200 Subject: [PATCH] More meaningful log messages --- issue_release_status.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/issue_release_status.go b/issue_release_status.go index b1ee008..5f1ea5c 100644 --- a/issue_release_status.go +++ b/issue_release_status.go @@ -97,7 +97,7 @@ func (handler *PRCreateHandler) Handle(ctx context.Context, eventType, deliveryI policyPath := handler.releaseManagerURL + "/policies?service=" describeArtifactPath := handler.releaseManagerURL + "/describe/artifact/" - // Filters + // Filters - Consider using Chain of Responsibility for this if it gets bloated. // - Action type if event.GetAction() != "opened" { logger.Info().Msgf("Filter ActionType triggered. Action: '%s'", event.GetAction()) @@ -110,14 +110,14 @@ func (handler *PRCreateHandler) Handle(ctx context.Context, eventType, deliveryI return errors.Wrap(err, "requesting describeArtifact from release manager") } if len(describeArtifactResponse.Artifacts) == 0 { - logger.Info().Msg("Filter UnmanagedRepo triggered") + logger.Info().Msgf("Filter UnmanagedService triggered. Service: '%s'", serviceName) return nil } // - Ignored repositories if any(handler.repoFilters, func(filterRepo string) bool { return filterRepo == repository.GetName() }) { - logger.Info().Msg("Filter IgnoredRepo triggered") + logger.Info().Msgf("Filter IgnoredRepo triggered. Repo: '%s'", repository.GetName()) return nil } @@ -163,7 +163,7 @@ func (handler *PRCreateHandler) Handle(ctx context.Context, eventType, deliveryI return errors.Wrapf(err, "commenting on pull request, with DeliveryID '%v'", deliveryID) } - logger.Info().Msg("Comment created") + logger.Info().Msgf("Comment created on %s PR %d", repositoryName, *event.PullRequest.Number) return nil }