Skip to content

Commit 1ab433a

Browse files
authored
Fix referencing isSilent under strict mode
1 parent 65511a7 commit 1ab433a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

log.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
this.isSilent = false;
1+
exports.isSilent = false;
22

33
var logLevel = 15,
44
escape = '"',
@@ -41,33 +41,33 @@ exports.setEscape = function( escapeChar ) {
4141
}
4242
};
4343

44-
exports.silence = function (isSilent) {
45-
return ( this.isSilent = isSilent );
44+
exports.silence = function (newIsSilent) {
45+
return ( exports.isSilent = isSilent );
4646
};
4747
exports.info = function () {
48-
if ((!this.isSilent || global.verbose) &&
48+
if ((!exports.isSilent || global.verbose) &&
4949
logLevel & level.info) {
5050
Array.prototype.unshift.call(arguments, '[INFO]');
5151
console.info.apply(console, arguments);
5252
}
5353
};
5454
exports.warn = function () {
55-
if ((!this.isSilent || global.verbose) &&
55+
if ((!exports.isSilent || global.verbose) &&
5656
logLevel & level.warn) {
5757
Array.prototype.unshift.call(arguments, '[WARN]');
5858
console.warn.apply(console, arguments);
5959
}
6060
};
6161
exports.error = function () {
62-
if ((!this.isSilent || global.verbose) &&
62+
if ((!exports.isSilent || global.verbose) &&
6363
logLevel & level.error) {
6464
Array.prototype.unshift.call(arguments, '[ERROR]');
6565
//console.trace( 'Trace from error log' );
6666
console.error.apply(console, arguments);
6767
}
6868
};
6969
exports.sql = function(sql) {
70-
if ((!this.isSilent && (global.dryRun || global.verbose)) &&
70+
if ((!exports.isSilent && (global.dryRun || global.verbose)) &&
7171
logLevel & level.sql) {
7272
var args = Array.prototype.slice.call(arguments).slice(1);
7373
args = args.slice(0, args.length - 1);

0 commit comments

Comments
 (0)