summaryrefslogtreecommitdiff
path: root/internal/command/shared
diff options
context:
space:
mode:
Diffstat (limited to 'internal/command/shared')
-rw-r--r--internal/command/shared/customaction/customaction.go18
1 files changed, 10 insertions, 8 deletions
diff --git a/internal/command/shared/customaction/customaction.go b/internal/command/shared/customaction/customaction.go
index 73d2ce4..191ec42 100644
--- a/internal/command/shared/customaction/customaction.go
+++ b/internal/command/shared/customaction/customaction.go
@@ -4,19 +4,17 @@ import (
"bytes"
"context"
"errors"
-
- "gitlab.com/gitlab-org/gitlab-shell/client"
-
"io"
"net/http"
+ "gitlab.com/gitlab-org/labkit/log"
+
+ "gitlab.com/gitlab-org/gitlab-shell/client"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/readwriter"
"gitlab.com/gitlab-org/gitlab-shell/internal/config"
"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet"
"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/accessverifier"
"gitlab.com/gitlab-org/gitlab-shell/internal/pktline"
-
- "gitlab.com/gitlab-org/labkit/log"
)
type Request struct {
@@ -59,12 +57,12 @@ func (c *Command) processApiEndpoints(ctx context.Context, response *accessverif
request.Data.UserId = response.Who
for _, endpoint := range data.ApiEndpoints {
- fields := log.Fields{
+ ctxlog := log.WithContextFields(ctx, log.Fields{
"primary_repo": data.PrimaryRepo,
"endpoint": endpoint,
- }
+ })
- log.WithContextFields(ctx, fields).Info("Performing custom action")
+ ctxlog.Info("customaction: processApiEndpoints: Performing custom action")
response, err := c.performRequest(ctx, client, endpoint, request)
if err != nil {
@@ -90,6 +88,10 @@ func (c *Command) processApiEndpoints(ctx context.Context, response *accessverif
} else {
output = c.readFromStdinNoEOF()
}
+ ctxlog.WithFields(log.Fields{
+ "eof_sent": c.EOFSent,
+ "stdin_bytes": len(output),
+ }).Debug("customaction: processApiEndpoints: stdin buffered")
request.Output = output
}