Skip to content

Commit

Permalink
Fix referencing isSilent under strict mode
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Peveler <[email protected]>
  • Loading branch information
MasterOdin committed Mar 9, 2023
1 parent 65511a7 commit 0d422ff
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions log.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
this.isSilent = false;
exports.isSilent = false;

var logLevel = 15,
escape = '"',
Expand Down Expand Up @@ -41,33 +41,33 @@ exports.setEscape = function( escapeChar ) {
}
};

exports.silence = function (isSilent) {
return ( this.isSilent = isSilent );
exports.silence = function (newIsSilent) {
return ( exports.isSilent = isSilent );
};
exports.info = function () {
if ((!this.isSilent || global.verbose) &&
if ((!exports.isSilent || global.verbose) &&
logLevel & level.info) {
Array.prototype.unshift.call(arguments, '[INFO]');
console.info.apply(console, arguments);
}
};
exports.warn = function () {
if ((!this.isSilent || global.verbose) &&
if ((!exports.isSilent || global.verbose) &&
logLevel & level.warn) {
Array.prototype.unshift.call(arguments, '[WARN]');
console.warn.apply(console, arguments);
}
};
exports.error = function () {
if ((!this.isSilent || global.verbose) &&
if ((!exports.isSilent || global.verbose) &&
logLevel & level.error) {
Array.prototype.unshift.call(arguments, '[ERROR]');
//console.trace( 'Trace from error log' );
console.error.apply(console, arguments);
}
};
exports.sql = function(sql) {
if ((!this.isSilent && (global.dryRun || global.verbose)) &&
if ((!exports.isSilent && (global.dryRun || global.verbose)) &&
logLevel & level.sql) {
var args = Array.prototype.slice.call(arguments).slice(1);
args = args.slice(0, args.length - 1);
Expand Down

0 comments on commit 0d422ff

Please sign in to comment.