We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c953c77 commit c52db69Copy full SHA for c52db69
src/reporters/basic.js
@@ -123,16 +123,11 @@ export default class BasicReporter {
123
}
124
125
getWriteMethod (isError, async) {
126
- return 'write' + (isError ? 'Error' : '') +
127
- (
128
- async === true
129
- ? 'Async'
130
- : (
131
- async === false
132
- ? 'Sync'
133
- : ''
134
- )
135
+ if (isError) {
+ return async ? this.writeErrorAsync : this.writeError
+ } else {
+ return async ? this.write : this.writeAsync
+ }
136
137
138
prepareWrite (logObj, fields) {
@@ -155,6 +150,6 @@ export default class BasicReporter {
155
150
156
151
const { format, argv } = this.prepareWrite(logObj, fields)
157
152
158
- return this[writeMethod](vsprintf(format, argv))
153
+ return writeMethod(vsprintf(format, argv))
159
154
160
0 commit comments