@@ -11,8 +11,6 @@ import { settlePromise } from './promises.js';
1111type GroupColor = Extract < AnsiColors , 'cyan' | 'magenta' > ;
1212type CiPlatform = 'GitHub Actions' | 'GitLab CI/CD' ;
1313
14- const GROUP_COLOR_ENV_VAR_NAME = 'CP_LOGGER_GROUP_COLOR' ;
15-
1614/**
1715 * Rich logging implementation for Code PushUp CLI, plugins, etc.
1816 *
@@ -26,11 +24,7 @@ export class Logger {
2624 : isEnvVarEnabled ( 'GITLAB_CI' )
2725 ? 'GitLab CI/CD'
2826 : undefined ;
29- #groupColor: GroupColor | undefined =
30- process . env [ GROUP_COLOR_ENV_VAR_NAME ] === 'cyan' ||
31- process . env [ GROUP_COLOR_ENV_VAR_NAME ] === 'magenta'
32- ? process . env [ GROUP_COLOR_ENV_VAR_NAME ]
33- : undefined ;
27+ #groupColor: GroupColor | undefined ;
3428
3529 #groupsCount = 0 ;
3630 #activeSpinner: Ora | undefined ;
@@ -51,7 +45,7 @@ export class Logger {
5145 text,
5246 symbol : this . #colorize( this . #groupSymbols. end , this . #groupColor) ,
5347 } ) ;
54- this . #setGroupColor ( undefined ) ;
48+ this . #groupColor = undefined ;
5549 } else {
5650 this . #activeSpinner. fail ( text ) ;
5751 }
@@ -271,7 +265,7 @@ export class Logger {
271265 this . newline ( ) ;
272266 }
273267
274- this . #setGroupColor ( this . #groupsCount % 2 === 0 ? 'cyan' : 'magenta' ) ;
268+ this . #groupColor = this . #groupsCount % 2 === 0 ? 'cyan' : 'magenta' ;
275269 this . #groupsCount++ ;
276270
277271 const groupMarkers = this . #createGroupMarkers( ) ;
@@ -308,7 +302,7 @@ export class Logger {
308302 if ( endMarker ) {
309303 console . log ( endMarker ) ;
310304 }
311- this . #setGroupColor ( undefined ) ;
305+ this . #groupColor = undefined ;
312306 this . newline ( ) ;
313307
314308 if ( result . status === 'rejected' ) {
@@ -366,15 +360,6 @@ export class Logger {
366360 return ansis . bold ( this . #colorize( text , this . #groupColor) ) ;
367361 }
368362
369- #setGroupColor( groupColor : GroupColor | undefined ) {
370- this . #groupColor = groupColor ;
371- if ( groupColor ) {
372- process . env [ GROUP_COLOR_ENV_VAR_NAME ] = groupColor ;
373- } else {
374- delete process . env [ GROUP_COLOR_ENV_VAR_NAME ] ;
375- }
376- }
377-
378363 async #spinner< T > (
379364 worker : ( ) => Promise < T > ,
380365 messages : {
0 commit comments