Skip to content

Commit

Permalink
refactor(CLI): Ensure telemetry logs are issued at debug level
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Dec 28, 2021
1 parent 6901fa6 commit 7b36038
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/utils/telemetry/index.js
Expand Up @@ -12,7 +12,7 @@ const { legacy, log } = require('@serverless/utils/log');
const isTelemetryDisabled = require('./areDisabled');
const cacheDirPath = require('./cache-path');

const debugLog = log.get('telemetry');
const telemetryLog = log.get('telemetry');

const timestampWeekBefore = Date.now() - 1000 * 60 * 60 * 24 * 7;

Expand All @@ -23,7 +23,7 @@ const isUuid = RegExp.prototype.test.bind(
let serverlessRunEndTime;

const logError = (type, error) => {
debugLog('User stats error: %s: %O', type, error);
telemetryLog.debug('User stats error: %s: %O', type, error);
if (!process.env.SLS_STATS_DEBUG) return;
legacy.log(format('User stats error: %s: %O', type, error));
};
Expand All @@ -42,7 +42,7 @@ const processResponseBody = async (response, ids, startTime) => {

const endTime = Date.now();
if (serverlessRunEndTime) {
debugLog(
telemetryLog.debug(
'Stats request prevented process from exiting for %dms (request time: %dms)',
endTime - serverlessRunEndTime,
endTime - startTime
Expand Down

0 comments on commit 7b36038

Please sign in to comment.