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

Commit 449d10f

Browse files
committed
Make debug lazy in locale-checker
1 parent 2132a84 commit 449d10f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/locale-checker.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
const spellchecker = require('spellchecker');
22
const pathspec = require('atom-pathspec');
33
const env = require('./checker-env');
4-
const debug = require('debug');
54

65
// The locale checker is a checker that takes a locale string (`en-US`) and
76
// optionally a path and then checks it.
@@ -22,7 +21,12 @@ class LocaleChecker {
2221
this.enabled = true;
2322
this.hasSystemChecker = hasSystemChecker;
2423
this.inferredLocale = inferredLocale;
25-
this.log = debug('spell-check:locale-checker').extend(locale);
24+
if (atom.config.get("spell-check.enableDebug")) {
25+
debug = require('debug');
26+
this.log = debug('spell-check:locale-checker').extend(locale);
27+
} else {
28+
this.log = console.log
29+
}
2630
this.log(
2731
'enabled',
2832
this.isEnabled(),

0 commit comments

Comments
 (0)