Skip to content

Commit 8182aa5

Browse files
authored
feat(telemetry): log metric names at "verbose" log-level #3414
1 parent 84ec4fc commit 8182aa5

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/shared/telemetry/telemetryLogger.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,19 @@ export class TelemetryLogger {
5959

6060
if (!isReleaseVersion()) {
6161
this._metrics.push(metric)
62-
const stringified = JSON.stringify(metric)
63-
getLogger().debug(`${msg} -> ${stringified}`)
62+
if (getLogger().logLevelEnabled('debug')) {
63+
const stringified = JSON.stringify(metric)
64+
getLogger().debug(`${msg} -> ${stringified}`)
65+
} else {
66+
getLogger().verbose(msg)
67+
}
6468

6569
if (this.metricCount > 1000) {
6670
this.clear()
67-
getLogger().debug('telemetry: cleared buffered metrics')
71+
getLogger().verbose('telemetry: cleared buffered metrics')
6872
}
6973
} else {
70-
getLogger().debug(msg)
74+
getLogger().verbose(msg)
7175
}
7276
}
7377

0 commit comments

Comments
 (0)