1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | var util = require('util');
|
13 |
|
14 |
|
15 |
|
16 | var sep = '===============================================================================';
|
17 | var line = '-------------------------------------------------------------------------------';
|
18 | var field = ' ';
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | module.exports.separator = function() {
|
24 | console.log(sep);
|
25 | };
|
26 |
|
27 |
|
28 | module.exports.sep = module.exports.separator;
|
29 |
|
30 |
|
31 | module.exports.line = function() {
|
32 | console.log(line);
|
33 | };
|
34 |
|
35 |
|
36 | module.exports.title = function(title) {
|
37 | var out = '--- ' + title + ' ';
|
38 | out += line.substr(out.length);
|
39 | console.log(out);
|
40 | };
|
41 |
|
42 |
|
43 | module.exports.field = function(key, value) {
|
44 | console.log('' + key + field.substr(key.length) + ' : ' + value);
|
45 | };
|
46 |
|
47 |
|
48 | module.exports.subfield = function(key, value) {
|
49 | console.log('- ' + key + field.substr(key.length + 2) + ' : ' + value);
|
50 | };
|
51 |
|
52 |
|
53 | module.exports.li = function(msg) {
|
54 | console.log('* ' + msg);
|
55 | };
|
56 |
|
57 |
|
58 | module.exports.dump = function(data, name) {
|
59 | if ( name ) {
|
60 | console.log(name + ' :', util.inspect(data, false, null, true));
|
61 | }
|
62 | else {
|
63 | console.log(util.inspect(data, false, null, true));
|
64 | }
|
65 | };
|
66 |
|
67 |
|
68 | module.exports.msg = function(msg) {
|
69 | console.log(msg);
|
70 | };
|
71 |
|
72 |
|