Skip to content

Commit bbe0b06

Browse files
Increase postman logging verbosity (#4160)
These are mostly tied directly to API calls, so they aren't likely to be too spammy. It would be nice if they were move easily visible in logs.
1 parent 6935658 commit bbe0b06

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

pkg/sources/postman/postman.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -355,15 +355,15 @@ func (s *Source) scanCollection(ctx context.Context, chunksChan chan *sources.Ch
355355
// collections don't have URLs in the Postman API, but we can scan the Authorization section without it.
356356
s.scanAuth(ctx, chunksChan, metadata, collection.Auth, URL{})
357357

358-
ctx.Logger().V(4).Info("Scanning events in collection",
358+
ctx.Logger().V(3).Info("Scanning events in collection",
359359
"collection_uid", collection.Info.Uid,
360360
"event_count", len(collection.Events),
361361
)
362362
for _, event := range collection.Events {
363363
s.scanEvent(ctx, chunksChan, metadata, event)
364364
}
365365

366-
ctx.Logger().V(4).Info("Scanning items in collection",
366+
ctx.Logger().V(3).Info("Scanning items in collection",
367367
"collection_uid", collection.Info.Uid,
368368
"item_ids", fp.Map(func(i Item) string { return i.Id })(collection.Items),
369369
)
@@ -374,7 +374,7 @@ func (s *Source) scanCollection(ctx context.Context, chunksChan chan *sources.Ch
374374
}
375375

376376
func (s *Source) scanItem(ctx context.Context, chunksChan chan *sources.Chunk, collection Collection, metadata Metadata, item Item, parentItemId string) {
377-
ctx.Logger().V(4).Info("Starting to scan item",
377+
ctx.Logger().V(3).Info("Starting to scan item",
378378
"item_uid", item.Uid,
379379
"item_parent_item_id", parentItemId,
380380
"item_descendent_item_uids", fp.Map(func(i Item) string { return i.Uid })(item.Items),
@@ -440,7 +440,7 @@ func (s *Source) scanItem(ctx context.Context, chunksChan chan *sources.Chunk, c
440440
s.scanAuth(ctx, chunksChan, metadata, item.Auth, item.Request.URL)
441441
metadata.LocationType = source_metadatapb.PostmanLocationType_UNKNOWN_POSTMAN
442442

443-
ctx.Logger().V(4).Info("Finished scanning item", "item_uid", item.Uid)
443+
ctx.Logger().V(3).Info("Finished scanning item", "item_uid", item.Uid)
444444
}
445445

446446
func (s *Source) scanEvent(ctx context.Context, chunksChan chan *sources.Chunk, metadata Metadata, event Event) {
@@ -568,7 +568,7 @@ func (s *Source) scanAuth(ctx context.Context, chunksChan chan *sources.Chunk, m
568568
}
569569

570570
func (s *Source) scanHTTPRequest(ctx context.Context, chunksChan chan *sources.Chunk, metadata Metadata, r Request) {
571-
ctx.Logger().V(4).Info("scanning http request",
571+
ctx.Logger().V(3).Info("scanning http request",
572572
"request_header_count", len(r.HeaderKeyValue),
573573
"request_has_string_header", r.HeaderString == nil,
574574
"request_url_query_param_count", len(r.URL.Query),
@@ -628,7 +628,7 @@ func (s *Source) scanHTTPRequest(ctx context.Context, chunksChan chan *sources.C
628628
}
629629

630630
func (s *Source) scanRequestBody(ctx context.Context, chunksChan chan *sources.Chunk, m Metadata, b Body) {
631-
ctx.Logger().V(4).Info("scanning request body",
631+
ctx.Logger().V(3).Info("scanning request body",
632632
"request_body_form_data_count", len(b.FormData),
633633
"request_body_url_encoded_param_count", len(b.URLEncoded),
634634
)

pkg/sources/postman/postman_client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ func (c *Client) GetWorkspace(ctx context.Context, workspaceUUID string) (Worksp
358358

359359
// GetEnvironmentVariables returns the environment variables for a given environment
360360
func (c *Client) GetEnvironmentVariables(ctx context.Context, environment_uuid string) (VariableData, error) {
361-
ctx.Logger().V(4).Info("getting environment variables", "environment_uuid", environment_uuid)
361+
ctx.Logger().V(3).Info("getting environment variables", "environment_uuid", environment_uuid)
362362
obj := struct {
363363
VariableData VariableData `json:"environment"`
364364
}{}
@@ -380,7 +380,7 @@ func (c *Client) GetEnvironmentVariables(ctx context.Context, environment_uuid s
380380

381381
// GetCollection returns the collection for a given collection
382382
func (c *Client) GetCollection(ctx context.Context, collection_uuid string) (Collection, error) {
383-
ctx.Logger().V(4).Info("getting collection", "collection_uuid", collection_uuid)
383+
ctx.Logger().V(3).Info("getting collection", "collection_uuid", collection_uuid)
384384
obj := struct {
385385
Collection Collection `json:"collection"`
386386
}{}

0 commit comments

Comments
 (0)