File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' vercel ' : patch
3+ ---
4+
5+ Add support for telemetry debugging via VERCEL_TELEMETRY_DEBUG. Telemetry collection is not currently enabled and when it is, will be a major version bump for the CLI.
Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ const main = async () => {
114114 } ) ;
115115
116116 const telemetryEventStore = new TelemetryEventStore ( {
117- isDebug : isDebugging ,
117+ isDebug : process . env . VERCEL_TELEMETRY_DEBUG === '1' ,
118118 output,
119119 } ) ;
120120
Original file line number Diff line number Diff line change @@ -102,6 +102,8 @@ export class TelemetryClient {
102102export class TelemetryEventStore {
103103 private events : Event [ ] ;
104104 private output : Output ;
105+ // Whether to log telemetry events to the console, this behavior is independent of the `--debug` flag
106+ // which is used to enable debug logging for the CLI as a whole.
105107 private isDebug : boolean ;
106108 private sessionId : string ;
107109
@@ -127,9 +129,11 @@ export class TelemetryEventStore {
127129
128130 save ( ) {
129131 if ( this . isDebug ) {
130- this . output . debug ( `${ LogLabel } Flushing Events` ) ;
132+ // Intentionally not using `this.output.debug` as it will
133+ // not write to stderr unless the is run with `--debug`
134+ this . output . log ( `${ LogLabel } Flushing Events` ) ;
131135 this . events . forEach ( event => {
132- this . output . debug ( JSON . stringify ( event ) ) ;
136+ this . output . log ( JSON . stringify ( event ) ) ;
133137 } ) ;
134138 }
135139 }
You can’t perform that action at this time.
0 commit comments