Skip to content

Commit 1f03083

Browse files
Muzaffer AydinMuzaffer Aydin
authored andcommitted
chore (docdb): reduce log verbosity by changing some info logs to debug
1 parent e9f5204 commit 1f03083

File tree

5 files changed

+37
-37
lines changed

5 files changed

+37
-37
lines changed

packages/core/src/docdb/explorer/dbClusterNode.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class DBClusterNode extends DBResourceNode {
4141
readonly clusterRole: DBClusterRole = 'regional'
4242
) {
4343
super(client, cluster.DBClusterIdentifier ?? '[Cluster]', vscode.TreeItemCollapsibleState.Collapsed)
44-
getLogger().info(`NEW DBClusterNode: ${cluster.DBClusterArn}`)
44+
getLogger().debug(`NEW DBClusterNode: ${cluster.DBClusterArn}`)
4545
this.arn = cluster.DBClusterArn ?? ''
4646
this.name = cluster.DBClusterIdentifier ?? ''
4747
this.contextValue = this.getContext()
@@ -51,15 +51,15 @@ export class DBClusterNode extends DBResourceNode {
5151
this.description = this.getDescription()
5252
this.tooltip = `${this.name}${os.EOL}Engine: ${this.cluster.EngineVersion}${os.EOL}Status: ${this.cluster.Status}`
5353
if (this.isStatusRequiringPolling()) {
54-
getLogger().info(`${this.arn} requires polling.`)
54+
getLogger().debug(`${this.arn} requires polling.`)
5555
this.trackChanges()
5656
} else {
57-
getLogger().info(`${this.arn} does NOT require polling.`)
57+
getLogger().debug(`${this.arn} does NOT require polling.`)
5858
}
5959
}
6060

6161
public override async getChildren(): Promise<AWSTreeNodeBase[]> {
62-
getLogger().info(`DBClusterNode.getChildren() called`)
62+
getLogger().debug(`DBClusterNode.getChildren() called`)
6363
return telemetry.docdb_listInstances.run(async () => {
6464
return await makeChildrenNodes({
6565
getChildNodes: async () => {
@@ -151,7 +151,7 @@ export class DBClusterNode extends DBResourceNode {
151151
return undefined
152152
}
153153

154-
getLogger().info(`Get Status: status ${cluster.Status} for cluster ${this.arn}`)
154+
getLogger().debug(`Get Status: status ${cluster.Status} for cluster ${this.arn}`)
155155
this.cluster.Status = cluster.Status
156156
return cluster.Status
157157
}
@@ -170,7 +170,7 @@ export class DBClusterNode extends DBResourceNode {
170170
}
171171

172172
override refreshTree(): void {
173-
getLogger().info(`(DBClusterNode) Refreshing tree for instance: ${this.arn}`)
173+
getLogger().debug(`(DBClusterNode) Refreshing tree for instance: ${this.arn}`)
174174
this.refresh()
175175
this.parent.refresh()
176176
}
@@ -179,7 +179,7 @@ export class DBClusterNode extends DBResourceNode {
179179
this.pollingSet.delete(this.arn)
180180
this.pollingSet.clearTimer()
181181
for (const node of this.childNodes) {
182-
getLogger().info(`(clearTimer) Removing Polling from node: ${node.arn}`)
182+
getLogger().debug(`(clearTimer) Removing Polling from node: ${node.arn}`)
183183
node.pollingSet.delete(node.arn)
184184
node.pollingSet.clearTimer()
185185
}

packages/core/src/docdb/explorer/dbElasticClusterNode.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ export class DBElasticClusterNode extends DBResourceNode {
3434
this.description = this.getDescription()
3535
this.tooltip = `${this.name}\nStatus: ${this.status}`
3636
if (this.isStatusRequiringPolling()) {
37-
getLogger().info(`${this.arn} requires polling.`)
37+
getLogger().debug(`${this.arn} requires polling.`)
3838
this.trackChanges()
3939
} else {
40-
getLogger().info(`${this.arn} does NOT require polling.`)
40+
getLogger().debug(`${this.arn} does NOT require polling.`)
4141
}
4242
}
4343

@@ -77,7 +77,7 @@ export class DBElasticClusterNode extends DBResourceNode {
7777

7878
override async getStatus() {
7979
const cluster = await this.client.getElasticCluster(this.arn)
80-
getLogger().info(`Get Status: status ${cluster?.status} for elastic-cluster ${this.arn}`)
80+
getLogger().debug(`Get Status: status ${cluster?.status} for elastic-cluster ${this.arn}`)
8181
this.cluster.status = cluster?.status
8282
return cluster?.status?.toLowerCase()
8383
}
@@ -101,7 +101,7 @@ export class DBElasticClusterNode extends DBResourceNode {
101101
}
102102

103103
override refreshTree(): void {
104-
getLogger().info(`(DBElasticClusterNode) Refreshing tree for instance: ${this.arn}`)
104+
getLogger().debug(`(DBElasticClusterNode) Refreshing tree for instance: ${this.arn}`)
105105
this.refresh()
106106
this.parent.refresh()
107107
}

packages/core/src/docdb/explorer/dbGlobalClusterNode.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ export class DBGlobalClusterNode extends DBResourceNode {
4848
this.description = 'Global cluster'
4949
this.tooltip = `${this.name}\nEngine: ${this.cluster.EngineVersion}\nStatus: ${this.cluster.Status} (read-only)`
5050
if (this.isStatusRequiringPolling()) {
51-
getLogger().info(`${this.arn} requires polling.`)
51+
getLogger().debug(`${this.arn} requires polling.`)
5252
this.trackChanges()
5353
} else {
54-
getLogger().info(`${this.arn} does NOT require polling.`)
54+
getLogger().debug(`${this.arn} does NOT require polling.`)
5555
}
5656
}
5757

@@ -135,7 +135,7 @@ export class DBGlobalClusterNode extends DBResourceNode {
135135
return undefined
136136
}
137137

138-
getLogger().info(`Get Status: status ${cluster.Status} for cluster ${this.arn}`)
138+
getLogger().debug(`Get Status: status ${cluster.Status} for cluster ${this.arn}`)
139139
this.cluster.Status = cluster.Status
140140
return cluster.Status
141141
}
@@ -151,7 +151,7 @@ export class DBGlobalClusterNode extends DBResourceNode {
151151
}
152152

153153
override refreshTree(): void {
154-
getLogger().info(`(DBGlobalClusterNode) Refreshing tree for instance: ${this.arn}`)
154+
getLogger().debug(`(DBGlobalClusterNode) Refreshing tree for instance: ${this.arn}`)
155155
this.refresh()
156156
this.parent.refresh()
157157
}

packages/core/src/docdb/explorer/dbInstanceNode.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ export class DBInstanceNode extends DBResourceNode {
2727
readonly instance: DBInstance
2828
) {
2929
super(parent.client, instance.DBInstanceIdentifier ?? '[Instance]', vscode.TreeItemCollapsibleState.None)
30-
getLogger().info(`NEW DBInstanceNode: ${instance.DBInstanceArn}`)
30+
getLogger().debug(`NEW DBInstanceNode: ${instance.DBInstanceArn}`)
3131
this.description = this.makeDescription()
3232
this.contextValue = this.getContext()
3333
this.iconPath = this.isAvailable || this.isStopped ? undefined : new vscode.ThemeIcon('loading~spin')
3434
this.tooltip = `${this.name}\nClass: ${this.instance.DBInstanceClass}\nStatus: ${this.status}`
35-
getLogger().info(`Parent of ${instance.DBInstanceArn} is ${parent.arn}`)
35+
getLogger().debug(`Parent of ${instance.DBInstanceArn} is ${parent.arn}`)
3636
if (this.isStatusRequiringPolling()) {
37-
getLogger().info(`${instance.DBInstanceArn} requires polling.`)
37+
getLogger().debug(`${instance.DBInstanceArn} requires polling.`)
3838
this.trackChanges()
3939
} else {
40-
getLogger().info(`${instance.DBInstanceArn} does NOT require polling.`)
40+
getLogger().debug(`${instance.DBInstanceArn} does NOT require polling.`)
4141
}
4242
}
4343

@@ -46,7 +46,7 @@ export class DBInstanceNode extends DBResourceNode {
4646
const parentRequiresPolling = this.parent.isStatusRequiringPolling()
4747
const requiresPolling = instanceRequiresPolling || parentRequiresPolling
4848

49-
getLogger().info(
49+
getLogger().debug(
5050
`isStatusRequiringPolling (DBInstanceNode): Instance ${this.arn} requires polling: ${instanceRequiresPolling}, Parent ${this.parent.arn} requires polling: ${parentRequiresPolling}, Combined result: ${requiresPolling}`
5151
)
5252

@@ -103,7 +103,7 @@ export class DBInstanceNode extends DBResourceNode {
103103
}
104104

105105
override refreshTree(): void {
106-
getLogger().info(`(DBInstanceNode) Refreshing tree for instance: ${this.arn}`)
106+
getLogger().debug(`(DBInstanceNode) Refreshing tree for instance: ${this.arn}`)
107107
this.refresh()
108108
this.parent.refreshTree()
109109
}

packages/core/src/docdb/explorer/dbResourceNode.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ export abstract class DBResourceNode extends AWSTreeNodeBase implements AWSResou
3535
) {
3636
super(label, collapsibleState)
3737
this.regionCode = client.regionCode
38-
getLogger().info(`NEW DBResourceNode`)
38+
getLogger().debug(`NEW DBResourceNode`)
3939
}
4040

4141
public isStatusRequiringPolling(): boolean {
4242
const currentStatus = this.status?.toLowerCase()
4343
const isProcessingStatus = currentStatus !== undefined && this.processingStatuses.has(currentStatus)
44-
getLogger().info(
44+
getLogger().debug(
4545
`isStatusRequiringPolling (DBResourceNode):: Checking if status "${currentStatus}" for ARN: ${this.arn} requires polling: ${isProcessingStatus}`
4646
)
4747
return isProcessingStatus
@@ -69,7 +69,7 @@ export abstract class DBResourceNode extends AWSTreeNodeBase implements AWSResou
6969

7070
public get isPolling(): boolean {
7171
const isPolling = DBResourceNode.globalPollingArns.has(this.arn)
72-
getLogger().info(`isPolling: ARN ${this.arn} is ${isPolling ? '' : 'not '}being polled.`)
72+
getLogger().debug(`isPolling: ARN ${this.arn} is ${isPolling ? '' : 'not '}being polled.`)
7373
return isPolling
7474
}
7575

@@ -101,11 +101,11 @@ export abstract class DBResourceNode extends AWSTreeNodeBase implements AWSResou
101101
const status = await this.getStatus()
102102
if (checkProcessingStatuses) {
103103
const isProcessingStatus = status !== undefined && this.processingStatuses.has(status.toLowerCase())
104-
getLogger().info('docdb: waitUntilStatusChangedToProcessingStatus: %O', isProcessingStatus)
104+
getLogger().debug('docdb: waitUntilStatusChangedToProcessingStatus: %O', isProcessingStatus)
105105
return isProcessingStatus
106106
} else {
107107
const hasStatusChanged = status !== this.status
108-
getLogger().info('docdb: waitUntilStatusChanged (status): %O', hasStatusChanged)
108+
getLogger().debug('docdb: waitUntilStatusChanged (status): %O', hasStatusChanged)
109109
return hasStatusChanged
110110
}
111111
},
@@ -116,28 +116,28 @@ export abstract class DBResourceNode extends AWSTreeNodeBase implements AWSResou
116116
}
117117

118118
public async trackChangesWithWaitProcessingStatus() {
119-
getLogger().info(
119+
getLogger().debug(
120120
`Preparing to track changes with waiting a processing status for ARN: ${this.arn}; condition: ${this.isPolling};`
121121
)
122122
if (!this.isPolling) {
123123
this.isPolling = true
124124
await this.waitUntilStatusChanged(true, 60000, 1000)
125-
getLogger().info(`Tracking changes for a processing status wait is over`)
125+
getLogger().debug(`Tracking changes for a processing status wait is over`)
126126
this.pollingSet.start(this.arn)
127-
getLogger().info(`Tracking changes for ARN: ${this.arn}; condition: ${this.isPolling};`)
127+
getLogger().debug(`Tracking changes for ARN: ${this.arn}; condition: ${this.isPolling};`)
128128
} else {
129-
getLogger().info(`ARN: ${this.arn} already being tracked`)
129+
getLogger().debug(`ARN: ${this.arn} already being tracked`)
130130
}
131131
}
132132

133133
public trackChanges() {
134-
getLogger().info(`Preparing to track immdiately for ARN: ${this.arn}; condition: ${this.isPolling};`)
134+
getLogger().debug(`Preparing to track immdiately for ARN: ${this.arn}; condition: ${this.isPolling};`)
135135
if (!this.isPolling) {
136136
this.isPolling = true
137137
this.pollingSet.start(this.arn)
138-
getLogger().info(`Tracking changes for ARN: ${this.arn}; condition: ${this.isPolling};`)
138+
getLogger().debug(`Tracking changes for ARN: ${this.arn}; condition: ${this.isPolling};`)
139139
} else {
140-
getLogger().info(`ARN: ${this.arn} already being tracked`)
140+
getLogger().debug(`ARN: ${this.arn} already being tracked`)
141141
}
142142
}
143143

@@ -156,16 +156,16 @@ export abstract class DBResourceNode extends AWSTreeNodeBase implements AWSResou
156156
private async updateNodeStatus() {
157157
const currentStatus = this.status
158158
const newStatus = await this.getStatus()
159-
getLogger().info(
159+
getLogger().debug(
160160
`docdb: ${this.arn} updateNodeStatus (new status): ${newStatus} (old status): ${currentStatus}`
161161
)
162162
if (currentStatus !== newStatus) {
163-
getLogger().info(`docdb: ${this.arn} updateNodeStatus - refreshing UI`)
163+
getLogger().info(`docdb: ${this.arn} status: ${newStatus}, refreshing UI`)
164164
this.refreshTree()
165165
}
166166
if (!this.isStatusRequiringPolling()) {
167-
getLogger().info(`docdb: ${this.arn} updateNodeStatus - refreshing UI`)
168-
getLogger().info(`pollingSet delete ${this.arn} updateNodeStatus`)
167+
getLogger().info(`docdb: ${this.arn} status: ${newStatus}, refreshing UI`)
168+
getLogger().debug(`pollingSet delete ${this.arn} updateNodeStatus`)
169169
this.pollingSet.delete(this.arn)
170170
this.pollingSet.clearTimer()
171171
this.isPolling = false

0 commit comments

Comments
 (0)