321 lines
9.3 KiB
HTML
321 lines
9.3 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>Code coverage report for index.js</title>
|
|
<meta charset="utf-8" />
|
|
<link rel="stylesheet" href="prettify.css" />
|
|
<link rel="stylesheet" href="base.css" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<style type='text/css'>
|
|
.coverage-summary .sorter {
|
|
background-image: url(sort-arrow-sprite.png);
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class='wrapper'>
|
|
<div class='pad1'>
|
|
<h1>
|
|
<a href="index.html">All files</a> index.js
|
|
</h1>
|
|
<div class='clearfix'>
|
|
<div class='fl pad1y space-right2'>
|
|
<span class="strong">100% </span>
|
|
<span class="quiet">Statements</span>
|
|
<span class='fraction'>27/27</span>
|
|
</div>
|
|
<div class='fl pad1y space-right2'>
|
|
<span class="strong">95% </span>
|
|
<span class="quiet">Branches</span>
|
|
<span class='fraction'>19/20</span>
|
|
</div>
|
|
<div class='fl pad1y space-right2'>
|
|
<span class="strong">100% </span>
|
|
<span class="quiet">Functions</span>
|
|
<span class='fraction'>4/4</span>
|
|
</div>
|
|
<div class='fl pad1y space-right2'>
|
|
<span class="strong">100% </span>
|
|
<span class="quiet">Lines</span>
|
|
<span class='fraction'>27/27</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class='status-line high'></div>
|
|
<pre><table class="coverage">
|
|
<tr><td class="line-count quiet">1
|
|
2
|
|
3
|
|
4
|
|
5
|
|
6
|
|
7
|
|
8
|
|
9
|
|
10
|
|
11
|
|
12
|
|
13
|
|
14
|
|
15
|
|
16
|
|
17
|
|
18
|
|
19
|
|
20
|
|
21
|
|
22
|
|
23
|
|
24
|
|
25
|
|
26
|
|
27
|
|
28
|
|
29
|
|
30
|
|
31
|
|
32
|
|
33
|
|
34
|
|
35
|
|
36
|
|
37
|
|
38
|
|
39
|
|
40
|
|
41
|
|
42
|
|
43
|
|
44
|
|
45
|
|
46
|
|
47
|
|
48
|
|
49
|
|
50
|
|
51
|
|
52
|
|
53
|
|
54
|
|
55
|
|
56
|
|
57
|
|
58
|
|
59
|
|
60
|
|
61
|
|
62
|
|
63
|
|
64
|
|
65
|
|
66
|
|
67
|
|
68
|
|
69
|
|
70
|
|
71
|
|
72
|
|
73
|
|
74
|
|
75
|
|
76
|
|
77
|
|
78
|
|
79
|
|
80
|
|
81
|
|
82
|
|
83
|
|
84
|
|
85
|
|
86</td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-yes">1x</span>
|
|
<span class="cline-any cline-yes">1x</span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-yes">1x</span>
|
|
<span class="cline-any cline-yes">12x</span>
|
|
<span class="cline-any cline-yes">12x</span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-yes">12x</span>
|
|
<span class="cline-any cline-yes">12x</span>
|
|
<span class="cline-any cline-yes">12x</span>
|
|
<span class="cline-any cline-yes">12x</span>
|
|
<span class="cline-any cline-yes">12x</span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-yes">12x</span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-yes">12x</span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-yes">4x</span>
|
|
<span class="cline-any cline-yes">4x</span>
|
|
<span class="cline-any cline-yes">4x</span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-yes">12x</span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-yes">2x</span>
|
|
<span class="cline-any cline-yes">2x</span>
|
|
<span class="cline-any cline-yes">2x</span>
|
|
<span class="cline-any cline-yes">1x</span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-yes">1x</span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-yes">1x</span>
|
|
<span class="cline-any cline-yes">21x</span>
|
|
<span class="cline-any cline-yes">1x</span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-yes">20x</span>
|
|
<span class="cline-any cline-yes">17x</span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-yes">3x</span>
|
|
<span class="cline-any cline-neutral"> </span>
|
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">'use strict';
|
|
|
|
const stream = require('stream');
|
|
const util = require('util');
|
|
|
|
/**
|
|
* Constructor function for the TransportStream. This is the base prototype
|
|
* that all `winston >= 3` transports should inherit from.
|
|
*
|
|
* @param {Object} opts Options for this TransportStream instance
|
|
* @param {String} opts.level HIGHEST level according to RFC5424.
|
|
* @param {Boolean} opts.handleExceptions If true, info with { exception: true } will be written.
|
|
* @param {Function} opts.log Custom log function for simple Transport creation
|
|
* @param {Function} opts.close Called on "unpipe" from parent
|
|
*/
|
|
var TransportStream = module.exports = function TransportStream(opts) {
|
|
stream.Writable.call(this, { objectMode: true });
|
|
opts = opts || {};
|
|
//
|
|
// TODO (indexzero): What do we do with formats on TransportStream
|
|
// instances? Should we do the same dance as in `winston.Logger`?
|
|
//
|
|
this.format = opts.format;
|
|
this.level = opts.level;
|
|
this.handleExceptions = opts.handleExceptions;
|
|
this.log = this.log || opts.log;
|
|
this.close = this.close || opts.close;
|
|
|
|
var self = this;
|
|
|
|
//
|
|
// Get the levels from the source we are piped from.
|
|
//
|
|
this.once('pipe', function (logger) {
|
|
//
|
|
// Remark (indexzero): this bookkeeping can only support multiple
|
|
// Logger parents with the same `levels`. This comes into play in
|
|
// the `winston.Container` code in which `container.add` takes
|
|
// a fully realized set of options with pre-constructed TransportStreams.
|
|
//
|
|
self.levels = logger.levels;
|
|
self.level = self.level || logger.level;
|
|
self.parent = logger;
|
|
});
|
|
|
|
//
|
|
// If and/or when the transport is removed from this instance
|
|
//
|
|
this.once('unpipe', function (src) {
|
|
//
|
|
// Remark (indexzero): this bookkeeping can only support multiple
|
|
// Logger parents with the same `levels`. This comes into play in
|
|
// the `winston.Container` code in which `container.add` takes
|
|
// a fully realized set of options with pre-constructed TransportStreams.
|
|
//
|
|
<span class="missing-if-branch" title="else path not taken" >E</span>if (src === self.parent) {
|
|
this.parent = null;
|
|
if (self.close) {
|
|
self.close();
|
|
}
|
|
}
|
|
});
|
|
};
|
|
|
|
util.inherits(TransportStream, stream.Writable);
|
|
|
|
/*
|
|
* @private function _write(info)
|
|
* Writes the info object to our transport instance.
|
|
*/
|
|
TransportStream.prototype._write = function (info, enc, callback) {
|
|
if (info.exception && !this.handleExceptions) {
|
|
return callback(null);
|
|
}
|
|
|
|
//
|
|
// Remark: This has to be handled in the base transport now because we cannot
|
|
// conditionally write to our pipe targets as stream.
|
|
//
|
|
if (!this.level || this.levels[this.level] >= this.levels[info.level]) {
|
|
return this.log(info, callback);
|
|
}
|
|
|
|
return callback(null);
|
|
};
|
|
</pre></td></tr>
|
|
</table></pre>
|
|
<div class='push'></div><!-- for sticky footer -->
|
|
</div><!-- /wrapper -->
|
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
Code coverage
|
|
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Mar 19 2017 14:55:18 GMT-0400 (EDT)
|
|
</div>
|
|
</div>
|
|
<script src="prettify.js"></script>
|
|
<script>
|
|
window.onload = function () {
|
|
if (typeof prettyPrint === 'function') {
|
|
prettyPrint();
|
|
}
|
|
};
|
|
</script>
|
|
<script src="sorter.js"></script>
|
|
</body>
|
|
</html>
|