@@ -112,23 +112,23 @@ function createLogger(options = {}) {
112
112
const nextStateLevel = getLogLevel ( level , formattedAction , [ nextState ] , `nextState` ) ;
113
113
114
114
if ( prevStateLevel ) {
115
- if ( colors . prevState ) logger [ level ] ( `%c prev state` , `color: ${ colors . prevState ( prevState ) } ; font-weight: bold` , prevState ) ;
116
- else logger [ level ] ( `prev state` , prevState ) ;
115
+ if ( colors . prevState ) logger [ prevStateLevel ] ( `%c prev state` , `color: ${ colors . prevState ( prevState ) } ; font-weight: bold` , prevState ) ;
116
+ else logger [ prevStateLevel ] ( `prev state` , prevState ) ;
117
117
}
118
118
119
119
if ( actionLevel ) {
120
- if ( colors . action ) logger [ level ] ( `%c action` , `color: ${ colors . action ( formattedAction ) } ; font-weight: bold` , formattedAction ) ;
121
- else logger [ level ] ( `action` , formattedAction ) ;
120
+ if ( colors . action ) logger [ actionLevel ] ( `%c action` , `color: ${ colors . action ( formattedAction ) } ; font-weight: bold` , formattedAction ) ;
121
+ else logger [ actionLevel ] ( `action` , formattedAction ) ;
122
122
}
123
123
124
124
if ( error && errorLevel ) {
125
- if ( colors . error ) logger [ level ] ( `%c error` , `color: ${ colors . error ( error , prevState ) } ; font-weight: bold` , error ) ;
126
- else logger [ level ] ( `error` , error ) ;
125
+ if ( colors . error ) logger [ errorLevel ] ( `%c error` , `color: ${ colors . error ( error , prevState ) } ; font-weight: bold` , error ) ;
126
+ else logger [ errorLevel ] ( `error` , error ) ;
127
127
}
128
128
129
129
if ( nextStateLevel ) {
130
- if ( colors . nextState ) logger [ level ] ( `%c next state` , `color: ${ colors . nextState ( nextState ) } ; font-weight: bold` , nextState ) ;
131
- else logger [ level ] ( `next state` , nextState ) ;
130
+ if ( colors . nextState ) logger [ nextStateLevel ] ( `%c next state` , `color: ${ colors . nextState ( nextState ) } ; font-weight: bold` , nextState ) ;
131
+ else logger [ nextStateLevel ] ( `next state` , nextState ) ;
132
132
}
133
133
134
134
try {
0 commit comments