@@ -171,16 +171,16 @@ methods: {
171
171
this .originalError = console .error ;
172
172
const self = this ;
173
173
174
- console .warn = function (text ) {
175
- self .log (' warning' , text );
174
+ console .warn = function () {
175
+ self .log (' warning' , arguments );
176
176
};
177
177
178
- console .log = function (text ) {
179
- self .log (' info' , text );
178
+ console .log = function () {
179
+ self .log (' info' , arguments );
180
180
};
181
181
182
- console .error = function (text ) {
183
- self .log (' danger' , text );
182
+ console .error = function () {
183
+ self .log (' danger' , arguments );
184
184
};
185
185
}
186
186
},
@@ -216,37 +216,18 @@ methods: {
216
216
}
217
217
},
218
218
methods: {
219
- log (tag , text ) {
220
- if (! text) {
221
- return ;
219
+ log (tag , args ) {
220
+ const argsArr = [tag];
221
+ for (let i = 0 ; i < args .length ; i++ ) {
222
+ argsArr .push (args[i]);
222
223
}
223
224
224
- if (! text .indexOf ) {
225
- text = String (text);
226
- }
227
-
228
- if (text .indexOf (' [HMR]' ) !== - 1 ) {
229
- return ;
230
- }
231
-
232
- // There is a bug when having more than 2 vue instances in detecting mutations.
233
- if (text .indexOf (' Avoid mutating a prop directly' ) !== - 1 ) {
234
- return ;
235
- }
236
-
237
- if (text .indexOf (' [Vue warn]' ) !== - 1 ) {
238
- tag = ' warning' ;
239
- }
240
-
241
- text = text .replace (' [Vue warn]: ' , ' ' );
225
+ this .originalLog .apply (console , argsArr);
242
226
243
227
if (this .messages .length > 10 ) {
244
228
this .messages .splice (10 );
245
229
}
246
-
247
- this .originalLog (text);
248
-
249
- this .messages .unshift ([tag, text]);
230
+ this .messages .unshift ([argsArr .shift (), argsArr .map (JSON .stringify ).join (' ' )]);
250
231
},
251
232
run () {
252
233
// Commit latest changes
0 commit comments