@salesforce/plugin-telemetry
Version:
Command usage and error telemetry for the Salesforce CLI
28 lines • 1.13 kB
JavaScript
/*
* Copyright (c) 2018, salesforce.com, inc.
* All rights reserved.
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import { SfCommand } from '@salesforce/sf-plugins-core';
import { isEnabled } from '@salesforce/telemetry/enabledCheck';
import Telemetry from '../telemetry.js';
export default class TelemetryGet extends SfCommand {
static hidden = true;
async run() {
const enabled = await isEnabled();
const cliId = global.cliTelemetry?.getCLIId();
this.log(`Telemetry is ${enabled ? 'enabled' : 'disabled'}.`);
this.log(`Telemetry tmp directory is ${Telemetry.tmpDir}.`);
this.log(`Telemetry cache directory is ${this.config.cacheDir}.`);
this.log();
this.log(`Salesforce CLI ID is ${cliId ?? '<undefined because global.cliTelemetry is undefined>'}.`);
return {
enabled,
cliId,
tmpDir: Telemetry.tmpDir,
cacheDir: this.config.cacheDir,
};
}
}
//# sourceMappingURL=telemetry.js.map