1 | var api = require('./lib/extra_api');
|
2 | var through = require('through2');
|
3 |
|
4 | "use strict";
|
5 |
|
6 | var disable = !!process.env.DISABLE_NOTIFIER;
|
7 |
|
8 | var fn = function (i) { return function () { return i; }; };
|
9 | var noopError = fn(function (err) {});
|
10 | var noopStream = function () { return through.obj(); };
|
11 |
|
12 |
|
13 | module.exports = disable ? noopStream : require('./lib/notify');
|
14 |
|
15 |
|
16 | module.exports.onError = disable ? noopError : api.onError;
|
17 |
|
18 |
|
19 | disable && api.logLevel(0);
|
20 |
|
21 |
|
22 | module.exports.logLevel = api.logLevel;
|
23 |
|
24 |
|
25 | module.exports.logger = api.logger;
|
26 |
|
27 |
|
28 | module.exports.withReporter = disable ? fn(noopStream) : require('./lib/withReporter');
|