| Total Complexity | 1 |
| Complexity/F | 0 |
| Lines of Code | 31 |
| Function Count | 0 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | /** |
||
| 2 | * Consoler |
||
| 3 | */ |
||
| 4 | [ |
||
| 5 | ["warn", "\x1b[35m"], |
||
| 6 | ["error", "\x1b[31m"], |
||
| 7 | ["log", "\x1b[2m"], |
||
| 8 | ].forEach(function (pair) { |
||
| 9 | var method = pair[0], |
||
| 10 | reset = "\x1b[0m", |
||
| 11 | color = "\x1b[36m" + pair[1]; |
||
| 12 | console[method] = console[method].bind( |
||
| 13 | console, |
||
| 14 | color, |
||
| 15 | `${method.toUpperCase()} [${new Date().getHours()}:${new Date().getMinutes()}:${new Date().getSeconds()}]`, |
||
| 16 | reset |
||
| 17 | ); |
||
| 18 | }); |
||
| 19 | |||
| 20 | console.error = (function () { |
||
| 21 | var error = console.error; |
||
| 22 | |||
| 23 | return function (exception: { stack: any }) { |
||
| 24 | if (typeof exception.stack !== "undefined") { |
||
| 25 | error.call(console, exception.stack); |
||
| 26 | } else { |
||
| 27 | error.apply(console, arguments); |
||
| 28 | } |
||
| 29 | }; |
||
| 30 | })(); |
||
| 31 |