Skip to content

Commit c8474f4

Browse files
committed
Make Debug Info ...
1 parent 92e1910 commit c8474f4

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

pkg/clients/tagging/v1/client.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ func NewClient(
7575
}
7676

7777
func (c client) GetResources(ctx context.Context, job model.DiscoveryJob, region string) ([]*model.TaggedResource, error) {
78+
c.logger.Info("Using tagging.Client V1")
7879
svc := config.SupportedServices.GetService(job.Namespace)
7980
var resources []*model.TaggedResource
8081
shouldHaveDiscoveredResources := false
@@ -124,7 +125,7 @@ func (c client) GetResources(ctx context.Context, job model.DiscoveryJob, region
124125
if resource.FilterThroughTags(job.SearchTags) {
125126
resources = append(resources, &resource)
126127
} else {
127-
c.logger.Debug("Skipping resource because search tags do not match", "arn", resource.ARN)
128+
c.logger.Info("Skipping resource because search tags do not match", "arn", resource.ARN)
128129
}
129130
}
130131
return !lastPage
@@ -133,7 +134,7 @@ func (c client) GetResources(ctx context.Context, job model.DiscoveryJob, region
133134
return nil, err
134135
}
135136

136-
c.logger.Debug("GetResourcesPages finished", "total", len(resources))
137+
c.logger.Info("GetResourcesPages finished", "total", len(resources))
137138
}
138139

139140
if ext, ok := ServiceFilters[svc.Namespace]; ok {
@@ -144,7 +145,7 @@ func (c client) GetResources(ctx context.Context, job model.DiscoveryJob, region
144145
return nil, fmt.Errorf("failed to apply ResourceFunc for %s, %w", svc.Namespace, err)
145146
}
146147
resources = append(resources, newResources...)
147-
c.logger.Debug("ResourceFunc finished", "total", len(resources))
148+
c.logger.Info("ResourceFunc finished", "total", len(resources))
148149
}
149150

150151
if ext.FilterFunc != nil {
@@ -153,7 +154,7 @@ func (c client) GetResources(ctx context.Context, job model.DiscoveryJob, region
153154
return nil, fmt.Errorf("failed to apply FilterFunc for %s, %w", svc.Namespace, err)
154155
}
155156
resources = filteredResources
156-
c.logger.Debug("FilterFunc finished", "total", len(resources))
157+
c.logger.Info("FilterFunc finished", "total", len(resources))
157158
}
158159
}
159160

pkg/clients/tagging/v2/client.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ func NewClient(
7575
}
7676

7777
func (c client) GetResources(ctx context.Context, job model.DiscoveryJob, region string) ([]*model.TaggedResource, error) {
78+
c.logger.Info("Using tagging.Client V2")
7879
svc := config.SupportedServices.GetService(job.Namespace)
7980
var resources []*model.TaggedResource
8081
shouldHaveDiscoveredResources := false
@@ -131,12 +132,12 @@ func (c client) GetResources(ctx context.Context, job model.DiscoveryJob, region
131132
if resource.FilterThroughTags(job.SearchTags) {
132133
resources = append(resources, &resource)
133134
} else {
134-
c.logger.Debug("Skipping resource because search tags do not match", "arn", resource.ARN)
135+
c.logger.Info("Skipping resource because search tags do not match", "arn", resource.ARN)
135136
}
136137
}
137138
}
138139

139-
c.logger.Debug("GetResourcesPages finished", "total", len(resources))
140+
c.logger.Info("GetResourcesPages finished", "total", len(resources))
140141
}
141142

142143
if ext, ok := ServiceFilters[svc.Namespace]; ok {
@@ -147,7 +148,7 @@ func (c client) GetResources(ctx context.Context, job model.DiscoveryJob, region
147148
return nil, fmt.Errorf("failed to apply ResourceFunc for %s, %w", svc.Namespace, err)
148149
}
149150
resources = append(resources, newResources...)
150-
c.logger.Debug("ResourceFunc finished", "total", len(resources))
151+
c.logger.Info("ResourceFunc finished", "total", len(resources))
151152
}
152153

153154
if ext.FilterFunc != nil {
@@ -156,7 +157,7 @@ func (c client) GetResources(ctx context.Context, job model.DiscoveryJob, region
156157
return nil, fmt.Errorf("failed to apply FilterFunc for %s, %w", svc.Namespace, err)
157158
}
158159
resources = filteredResources
159-
c.logger.Debug("FilterFunc finished", "total", len(resources))
160+
c.logger.Info("FilterFunc finished", "total", len(resources))
160161
}
161162
}
162163

0 commit comments

Comments
 (0)