Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 4180f9b

Browse files
committed
Use an empty function when debug is not enabled
1 parent 81a88d3 commit 4180f9b

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

lib/locale-checker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class LocaleChecker {
2525
debug = require('debug');
2626
this.log = debug('spell-check:locale-checker').extend(locale);
2727
} else {
28-
this.log = console.log
28+
this.log = (str) => {};
2929
}
3030
this.log(
3131
'enabled',

lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ let spellCheckViews = {};
55

66
const LARGE_FILE_SIZE = 2 * 1024 * 1024;
77

8-
let log = console.log
8+
let log = (str) => {};
99

1010
module.exports = {
1111
activate() {

lib/spell-check-manager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ class SpellCheckerManager {
427427
debug = require('debug');
428428
this.log = debug('spell-check:spell-check-manager');
429429
} else {
430-
this.log = console.log
430+
this.log = (str) => {};
431431
}
432432

433433
// Set up the system checker.

lib/system-checker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class SystemChecker {
2727
debug = require('debug');
2828
this.log = debug('spell-check:system-checker');
2929
} else {
30-
this.log = console.log
30+
this.log = (str) => {};
3131
}
3232
this.log('enabled', this.isEnabled(), this.getStatus());
3333
}

0 commit comments

Comments
 (0)