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

Commit 81a88d3

Browse files
committed
Make debug lazy in system-checker
1 parent 8f960a9 commit 81a88d3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/system-checker.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ let instance;
22
const spellchecker = require('spellchecker');
33
const pathspec = require('atom-pathspec');
44
const env = require('./checker-env');
5-
const debug = require('debug');
65

76
// Initialize the global spell checker which can take some time. We also force
87
// the use of the system or operating system library instead of Hunspell.
@@ -24,7 +23,12 @@ if (env.isSystemSupported()) {
2423
// due to some memory bug.
2524
class SystemChecker {
2625
constructor() {
27-
this.log = debug('spell-check:system-checker');
26+
if (atom.config.get("spell-check.enableDebug")) {
27+
debug = require('debug');
28+
this.log = debug('spell-check:system-checker');
29+
} else {
30+
this.log = console.log
31+
}
2832
this.log('enabled', this.isEnabled(), this.getStatus());
2933
}
3034

0 commit comments

Comments
 (0)