Change the name of the logger that log.* should call

        Args:
            **fields: Extra fields to be logged. Logger name will be:
                ".".join([<module_name>, <cls_name>] + fields_sorted_on_key)
12829
def set_logger(self, **fields):
        
        names = [self.__module__, self.__class__.__name__]
        for field, value in sorted(fields.items()):
            names.append(value)
        # names should be something like this for one field:
        #   ["malcolm.modules.scanning.controllers.runnablecontroller",
        #    "RunnableController", "BL45P-ML-SCAN-01"]
        self.log = logging.getLogger(".".join(names))
        if fields:
            self.log.addFilter(FieldFilter(fields))
        return self.log
656897
def init_log(*handlers, **kwargs):
    
    disable_existing_loggers = kwargs.get('disable_existing_loggers', False)

    handlers_config = [t.get_handler() for t in handlers]
    new_handlers_config = {}
    for t in handlers_config:
        new_handlers_config.update(t)

    formatter_config = [t.get_formatter() for t in handlers]
    new_formatter_config = {}
    for t in formatter_config:
        new_formatter_config.update(t)

    handler_name_list = [t.get_formatter_name() for t in handlers]
    dict_config = {
        'version': 1,
        'disable_existing_loggers': disable_existing_loggers,
        'formatters': new_formatter_config,
        'handlers': new_handlers_config,
        'loggers': {
            '': {
                'handlers': handler_name_list,
                'level': 'DEBUG',
            }
        }
    }

    logging.config.dictConfig(dict_config)
701218
def update_field(self, name, update):
        
        for field in self.__next_descriptor['fields']:
            if field['name'] == name:
                field.update(update)
                return True
        return False
1170104
def set_field(self, name, value):
        """"""
        f = getattr(self, name, None)
        if isinstance(f, DataField):
            f.set(self, value)
        else:
            raise FieldError("No field named '%s'" % name)
659795
def set_logger(self, logger_name, level=logging.INFO):
        
        log = logging.getLogger(logger_name)
        log.setLevel(level)

        ch = logging.StreamHandler(None)
        ch.setLevel(level)

        # create formatter
        if level == logging.INFO:
            formatter = logging.Formatter(InfoFmtString)
        else:
            formatter = logging.Formatter(DebugFmtString)

        # add formatter to ch
        ch.setFormatter(formatter)

        # add ch to logger
        log.addHandler(ch)
909593
def add_field(self, name, data):
        
        if name in self._fields:
            raise ValueError
        if not len(data) == self._num_fix:
            raise ValueError
        self._fields.append(name)
        self.__dict__[name] = data
738845
def add_parameter(self, field_name, param_name, param_value):
        
        try:
            self.fields[field_name]['params'][param_name] = param_value
        except Exception as ex:
            raise ScriptFieldsError("Error adding parameter %s with value %s :%s" % (param_name, param_value, ex))

        return self
874335
def get_logger(cls, custom_name=None):
        """"""
        name = custom_name or cls.get_name()
        return logging.getLogger(name)
917525
def set_handler(self, log, handler):
        
        if self.debug_logging is True:
            log.setLevel(logging.DEBUG)
            handler.setLevel(logging.DEBUG)
        else:
            log.setLevel(logging.INFO)
            handler.setLevel(logging.INFO)

        handler.name = self.name
        handler.setFormatter(self.format)
        log.addHandler(handler)
1002821
def add_field(self, field_name: str, field: Field, vocab: Vocabulary = None) -> None:
        
        self.fields[field_name] = field
        if self.indexed:
            field.index(vocab)
830657
def reset(self, name):
        
        message_type = type(self)
        try:
            field = message_type.field_by_name(name)
        except KeyError:
            if name not in message_type.__by_name:
                raise AttributeError('Message %s has no field %s' % (
                    message_type.__name__, name))
        if field.repeated:
            self.__tags[field.number] = FieldList(field, [])
        else:
            self.__tags.pop(field.number, None)
712592
def set_filename(self, filename):
        
        self.filename = filename
        self.logger = logging.getLogger(filename)
30286
def set_fields(
            self,
            new_fields):
        
        self.org_fields = {}
        self.fields_to_add = {}
        for k in new_fields:
            self.org_fields[k] = new_fields[k]
            self.fields_to_add[k] = new_fields[k]
280080
def set_name(self, name):
        
        self.name = name
        self.changed_event.emit(self)
733222
def addLogger(self, logger, level=logging.INFO):
        
        if isinstance(logger, logging.Logger):
            logger = logger.name
        
        if logger in self._loggers:
            return
        
        # allow the handler to determine the level for this logger
        if logger == 'root':
            _log = logging.getLogger()
        else:
            _log = logging.getLogger(logger)
        
        _log.addHandler(self.handler())
        
        self._loggers.add(logger)
        self.handler().setLoggerLevel(logger, level)
799607
def get_verbose_field_name(instance, field_name):
    
    fields = [field.name for field in instance._meta.fields]
    if field_name in fields:
        return instance._meta.get_field(field_name).verbose_name
    else:
        return field_name
749244
def remove_field(self, field):
        
        new_field = FieldFactory(
            field,
        )
        new_field.set_table(self)
        new_field_identifier = new_field.get_identifier()
        for field in self.fields:
            if field.get_identifier() == new_field_identifier:
                self.fields.remove(field)
                return field
        return None