mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) add a cli command to view telemetry settings
Summary: This adds a `yarn cli settings telemetry [--json] [--all]` command that allows telemetry settings to be inspected. It is useful for keeping documentation about telemetry up to date. Test Plan: manual (a bit cheeky; justified on basis of breakage not being very important yet, this is essentially an internal feature) Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D3917
This commit is contained in:
@@ -162,11 +162,9 @@ export class Telemetry implements ITelemetry {
|
||||
}
|
||||
|
||||
private async _initialize() {
|
||||
this._telemetryLevel = getTelemetryLevel();
|
||||
if (process.env.GRIST_TELEMETRY_LEVEL !== undefined) {
|
||||
this._telemetryLevel = TelemetryLevels.check(process.env.GRIST_TELEMETRY_LEVEL);
|
||||
this._checkTelemetryEvent = buildTelemetryEventChecker(this._telemetryLevel);
|
||||
} else {
|
||||
this._telemetryLevel = 'off';
|
||||
}
|
||||
|
||||
const {id} = await this._gristServer.getActivations().current();
|
||||
@@ -218,3 +216,11 @@ export class Telemetry implements ITelemetry {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export function getTelemetryLevel(): TelemetryLevel {
|
||||
if (process.env.GRIST_TELEMETRY_LEVEL !== undefined) {
|
||||
return TelemetryLevels.check(process.env.GRIST_TELEMETRY_LEVEL);
|
||||
} else {
|
||||
return 'off';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user