Skip to content

Commit

Permalink
Check for TELEMETRY_DISABLED before TELEMETRY_DEBUG in segment event …
Browse files Browse the repository at this point in the history
…handler, and log events that have been ignored.
  • Loading branch information
TheRealJon committed Mar 20, 2024
1 parent a3b1590 commit 2c140d2
Showing 1 changed file with 9 additions and 3 deletions.
Expand Up @@ -110,12 +110,18 @@ export const eventListener: TelemetryEventListener = async (
eventType: string,
properties?: any,
) => {
if (TELEMETRY_DEBUG) {
if (TELEMETRY_DISABLED || !apiKey) {
// eslint-disable-next-line no-console
console.debug('console-telemetry-plugin: received telemetry event:', eventType, properties);
console.debug(
'console-telemetry-plugin: telemetry disabled - ignoring telemetry event:',
eventType,
properties,
);
return;
}
if (TELEMETRY_DISABLED || !apiKey) {
if (TELEMETRY_DEBUG) {
// eslint-disable-next-line no-console
console.debug('console-telemetry-plugin: received telemetry event:', eventType, properties);
return;
}
switch (eventType) {
Expand Down

0 comments on commit 2c140d2

Please sign in to comment.