@@ -76,7 +76,9 @@ function printBuffer(buffer, options) {
7676 // Render
7777 try {
7878 if ( isCollapsed ) {
79- if ( colors . title && isUsingDefaultFormatter ) { logger . groupCollapsed ( `%c ${ title } ` , ...headerCSS ) ; } else logger . groupCollapsed ( title ) ;
79+ if ( colors . title && isUsingDefaultFormatter ) {
80+ logger . groupCollapsed ( `%c ${ title } ` , ...headerCSS ) ;
81+ } else logger . groupCollapsed ( title ) ;
8082 } else if ( colors . title && isUsingDefaultFormatter ) {
8183 logger . group ( `%c ${ title } ` , ...headerCSS ) ;
8284 } else {
@@ -93,41 +95,33 @@ function printBuffer(buffer, options) {
9395
9496 if ( prevStateLevel ) {
9597 if ( colors . prevState ) {
96- logger [ prevStateLevel ] (
97- '%c prev state' ,
98- `color: ${ colors . prevState ( prevState ) } ; font-weight: bold` ,
99- prevState ,
100- ) ;
98+ const styles = `color: ${ colors . prevState ( prevState ) } ; font-weight: bold` ;
99+
100+ logger [ prevStateLevel ] ( '%c prev state' , styles , prevState ) ;
101101 } else logger [ prevStateLevel ] ( 'prev state' , prevState ) ;
102102 }
103103
104104 if ( actionLevel ) {
105105 if ( colors . action ) {
106- logger [ actionLevel ] (
107- '%c action ' ,
108- `color: ${ colors . action ( formattedAction ) } ; font-weight: bold` ,
109- formattedAction ,
110- ) ;
106+ const styles = `color: ${ colors . action ( formattedAction ) } ; font-weight: bold` ;
107+
108+ logger [ actionLevel ] ( '%c action ' , styles , formattedAction ) ;
111109 } else logger [ actionLevel ] ( 'action ' , formattedAction ) ;
112110 }
113111
114112 if ( error && errorLevel ) {
115113 if ( colors . error ) {
116- logger [ errorLevel ] (
117- '%c error ' ,
118- `color: ${ colors . error ( error , prevState ) } ; font-weight: bold;` ,
119- error ,
120- ) ;
114+ const styles = `color: ${ colors . error ( error , prevState ) } ; font-weight: bold;` ;
115+
116+ logger [ errorLevel ] ( '%c error ' , styles , error ) ;
121117 } else logger [ errorLevel ] ( 'error ' , error ) ;
122118 }
123119
124120 if ( nextStateLevel ) {
125121 if ( colors . nextState ) {
126- logger [ nextStateLevel ] (
127- '%c next state' ,
128- `color: ${ colors . nextState ( nextState ) } ; font-weight: bold` ,
129- nextState ,
130- ) ;
122+ const styles = `color: ${ colors . nextState ( nextState ) } ; font-weight: bold` ;
123+
124+ logger [ nextStateLevel ] ( '%c next state' , styles , nextState ) ;
131125 } else logger [ nextStateLevel ] ( 'next state' , nextState ) ;
132126 }
133127
0 commit comments