Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Avatar for KuCalc : devops.
Download
50659 views
1
/*
2
* inspect.js: Plugin responsible for attaching inspection behavior using `cliff` and `eyes`.
3
*
4
* (C) 2011, Nodejitsu Inc.
5
* MIT LICENSE
6
*
7
*/
8
9
//
10
// ### Name this plugin
11
//
12
exports.name = 'inspect';
13
14
//
15
// ### function init (done)
16
// #### @done {function} Continuation to respond to when complete.
17
// Attaches inspection behavior through `cliff` and `eyes`.
18
//
19
exports.init = function (done) {
20
var namespace = 'default',
21
app = this;
22
23
if (app.options['inspect'] && app.options['inspect'].namespace) {
24
namespace = app.options['inspect'].namespace;
25
}
26
27
app.inspect = require('cliff');
28
app.inspect.logger = app.log.get('namespace');
29
done();
30
};
31
32
//
33
// ### function detact()
34
// Removes inspection behavior exposed by this plugin.
35
//
36
exports.detach = function () {
37
if (this.inspect) {
38
delete this.inspect;
39
}
40
};
41