-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_debug.js
More file actions
33 lines (24 loc) · 694 Bytes
/
_debug.js
File metadata and controls
33 lines (24 loc) · 694 Bytes
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
/* jslint laxbreak: true */
'use strict';
var fs = require('fs');
var path = require('path');
var name = require('../package').name;
var ws = fs.createWriteStream(name+'-log.json', { flags : 'w+' });
function inspector(key, value){
if( key === '_onTimeout' ){
return (value+'').split(/\n[ ]{2}|\n/);
}
return value;
}
function debugBatch(label, batch){
var sign = { };
sign['module ['+batch.module + '] ' + label] =
' location ' + path.basename(batch.location) +
' handle? ' + (batch.handle ? true : false);
ws.write(
JSON.stringify(sign, null, '') + '\n' +
JSON.stringify(batch, inspector, ' ') + '\n' +
'\n\n'
);
}
module.exports = debugBatch;