|
1 | | -this.isSilent = false; |
| 1 | +exports.isSilent = false; |
2 | 2 |
|
3 | 3 | var logLevel = 15, |
4 | 4 | escape = '"', |
@@ -41,33 +41,33 @@ exports.setEscape = function( escapeChar ) { |
41 | 41 | } |
42 | 42 | }; |
43 | 43 |
|
44 | | -exports.silence = function (isSilent) { |
45 | | - return ( this.isSilent = isSilent ); |
| 44 | +exports.silence = function (newIsSilent) { |
| 45 | + return ( exports.isSilent = isSilent ); |
46 | 46 | }; |
47 | 47 | exports.info = function () { |
48 | | - if ((!this.isSilent || global.verbose) && |
| 48 | + if ((!exports.isSilent || global.verbose) && |
49 | 49 | logLevel & level.info) { |
50 | 50 | Array.prototype.unshift.call(arguments, '[INFO]'); |
51 | 51 | console.info.apply(console, arguments); |
52 | 52 | } |
53 | 53 | }; |
54 | 54 | exports.warn = function () { |
55 | | - if ((!this.isSilent || global.verbose) && |
| 55 | + if ((!exports.isSilent || global.verbose) && |
56 | 56 | logLevel & level.warn) { |
57 | 57 | Array.prototype.unshift.call(arguments, '[WARN]'); |
58 | 58 | console.warn.apply(console, arguments); |
59 | 59 | } |
60 | 60 | }; |
61 | 61 | exports.error = function () { |
62 | | - if ((!this.isSilent || global.verbose) && |
| 62 | + if ((!exports.isSilent || global.verbose) && |
63 | 63 | logLevel & level.error) { |
64 | 64 | Array.prototype.unshift.call(arguments, '[ERROR]'); |
65 | 65 | //console.trace( 'Trace from error log' ); |
66 | 66 | console.error.apply(console, arguments); |
67 | 67 | } |
68 | 68 | }; |
69 | 69 | exports.sql = function(sql) { |
70 | | - if ((!this.isSilent && (global.dryRun || global.verbose)) && |
| 70 | + if ((!exports.isSilent && (global.dryRun || global.verbose)) && |
71 | 71 | logLevel & level.sql) { |
72 | 72 | var args = Array.prototype.slice.call(arguments).slice(1); |
73 | 73 | args = args.slice(0, args.length - 1); |
|
0 commit comments