function composeLoggerConfig(opts) {
  const { globalConfig, localConfig, cliConfig } = opts;

  const items = [
    {
      level: 'info',
      overrideConsole: true,
      options: defaultOptions,
    },
    globalConfig.logger,
    localConfig.logger,
    adaptCLI(cliConfig),
  ];

  return items.reduce(
    /**
     * @param {Partial<Detox.DetoxLoggerConfig>} acc
     * @param config
     */
    (acc, config) => {
      if (!config) return acc;
      const { options } = config;
      return _.merge(acc, {
        // @ts-ignore-line
        options: typeof options === 'function' ? options(acc) : options
      });
    },
    items.reduce((a, b) => _.merge(a, _.omit(b, 'options')), {})
  );
}
@param {object} opts
@param {Detox.DetoxConfig} opts.globalConfig
@param {Detox.DetoxConfiguration} opts.localConfig
@param {*} opts.cliConfig