Skip to content

Commit 46b65ee

Browse files
author
Mark Lozano
committed
Decoupled logger option from debug option
1 parent 4e81cdc commit 46b65ee

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: src/reactor.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,14 @@ class Reactor {
2929
const baseOptions = debug ? DEBUG_OPTIONS : PROD_OPTIONS
3030
// if defined, merge the custom implementation over the noop logger to avoid undefined lookups,
3131
// otherwise, just use the built-in console group logger
32-
const debugLogger = config.logger ? extend({}, NoopLogger, config.logger) : ConsoleGroupLogger
32+
let logger = config.logger ? extend({}, NoopLogger, config.logger) : NoopLogger
33+
if (!config.logger && debug) {
34+
logger = ConsoleGroupLogger
35+
}
3336
const initialReactorState = new ReactorState({
3437
debug: debug,
3538
cache: config.cache || DefaultCache(),
36-
logger: debug ? debugLogger : NoopLogger,
39+
logger: logger,
3740
// merge config options with the defaults
3841
options: baseOptions.merge(config.options || {}),
3942
})

0 commit comments

Comments
 (0)