<commit_before>import Immutable from 'immutable'
import createReactMixin from './create-react-mixin'
import * as fns from './reactor/fns'
import { DefaultCache } from './reactor/cache'
import { NoopLogger, ConsoleGroupLogger } from './logging'
import { isKeyPath } from './key-path'
import { isGetter } from './getter'
import { toJS } from './immutable-helpers'
import { extend, toFactory } from './utils'
import {
  ReactorState,
  ObserverState,
  DEBUG_OPTIONS,
  PROD_OPTIONS,
} from './reactor/records'

/**
 * State is stored in NuclearJS Reactors.  Reactors
 * contain a 'state' object which is an Immutable.Map
 *
 * The only way Reactors can change state is by reacting to
 * messages.  To update state, Reactor's dispatch messages to
 * all registered cores, and the core returns it's new
 * state based on the message
 */
class Reactor {
  constructor(config = {}) {
    const debug = !!config.debug
    const baseOptions = debug ? DEBUG_OPTIONS : PROD_OPTIONS
    // if defined, merge the custom implementation over the noop logger to avoid undefined lookups,
    // otherwise, just use the built-in console group logger
    const debugLogger = config.logger ? extend({}, NoopLogger, config.logger) : ConsoleGroupLogger
    const initialReactorState = new ReactorState({
      debug: debug,
      cache: config.cache || DefaultCache(),
      logger: debug ? debugLogger : NoopLogger,
      // merge config options with the defaults
      options: baseOptions.merge(config.options || {}),
    })
<commit_msg>Decoupled logger option from debug option<commit_after>import Immutable from 'immutable'
import createReactMixin from './create-react-mixin'
import * as fns from './reactor/fns'
import { DefaultCache } from './reactor/cache'
import { NoopLogger, ConsoleGroupLogger } from './logging'
import { isKeyPath } from './key-path'
import { isGetter } from './getter'
import { toJS } from './immutable-helpers'
import { extend, toFactory } from './utils'
import {
  ReactorState,
  ObserverState,
  DEBUG_OPTIONS,
  PROD_OPTIONS,
} from './reactor/records'

/**
 * State is stored in NuclearJS Reactors.  Reactors
 * contain a 'state' object which is an Immutable.Map
 *
 * The only way Reactors can change state is by reacting to
 * messages.  To update state, Reactor's dispatch messages to
 * all registered cores, and the core returns it's new
 * state based on the message
 */
class Reactor {
  constructor(config = {}) {
    const debug = !!config.debug
    const baseOptions = debug ? DEBUG_OPTIONS : PROD_OPTIONS
    // if defined, merge the custom implementation over the noop logger to avoid undefined lookups,
    // otherwise, just use the built-in console group logger
    let logger = config.logger ? extend({}, NoopLogger, config.logger) : NoopLogger
    if (!config.logger && debug) {
      logger = ConsoleGroupLogger
    }
    const initialReactorState = new ReactorState({
      debug: debug,
      cache: config.cache || DefaultCache(),
      logger: logger,
      // merge config options with the defaults
      options: baseOptions.merge(config.options || {}),
    })

{'fraction_non_alphanumeric': 0.10096774193548387, 'fraction_numerical': 0.0, 'mean_word_length': 3.6283582089552238, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2171338', 'n_tokens_mistral': 867, 'n_tokens_neox': 864, 'n_words': 318}