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

Commit 8f960a9

Browse files
committed
Make debug lazy in spell-check-manager
1 parent 449d10f commit 8f960a9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/spell-check-manager.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const debug = require('debug');
21
const env = require('./checker-env');
32

43
class SpellCheckerManager {
@@ -424,7 +423,12 @@ class SpellCheckerManager {
424423

425424
init() {
426425
// Set up logging.
427-
this.log = debug('spell-check:spell-check-manager');
426+
if (atom.config.get("spell-check.enableDebug")) {
427+
debug = require('debug');
428+
this.log = debug('spell-check:spell-check-manager');
429+
} else {
430+
this.log = console.log
431+
}
428432

429433
// Set up the system checker.
430434
const hasSystemChecker = this.useSystem && env.isSystemSupported();

0 commit comments

Comments
 (0)