1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 | Object.defineProperty(exports, "__esModule", { value: true });
|
6 | var Logger = (function () {
|
7 | function Logger(name, callback) {
|
8 | this.name = name;
|
9 | this.errors = [];
|
10 | this.callback = callback;
|
11 |
|
12 | }
|
13 | Logger.prototype.log = function (err) {
|
14 | this.errors.push(err);
|
15 | if (typeof this.callback === 'function') {
|
16 | this.callback(err);
|
17 | }
|
18 | };
|
19 | Logger.prototype.printOneError = function (e) {
|
20 | return e.stack;
|
21 | };
|
22 | Logger.prototype.printAllErrors = function () {
|
23 | var _this = this;
|
24 | return this.errors.reduce(function (agg, e) { return agg + "\n" + _this.printOneError(e); }, '');
|
25 | };
|
26 | return Logger;
|
27 | }());
|
28 | exports.Logger = Logger;
|
29 |
|
\ | No newline at end of file |