def __prep_mod_opts(self, opts):
        '''
        Strip out of the opts any logger instance
        '''
        if '__grains__' not in self.pack:
            grains = opts.get('grains', {})

            if isinstance(grains, ThreadLocalProxy):
                grains = ThreadLocalProxy.unproxy(grains)

            self.context_dict['grains'] = grains
            self.pack['__grains__'] = salt.utils.context.NamespacedDictWrapper(self.context_dict, 'grains')

        if '__pillar__' not in self.pack:
            pillar = opts.get('pillar', {})

            if isinstance(pillar, ThreadLocalProxy):
                pillar = ThreadLocalProxy.unproxy(pillar)

            self.context_dict['pillar'] = pillar
            self.pack['__pillar__'] = salt.utils.context.NamespacedDictWrapper(self.context_dict, 'pillar')

        mod_opts = {}
        for key, val in list(opts.items()):
            if key == 'logger':
                continue
            mod_opts[key] = val
        return mod_opts
Strip out of the opts any logger instance