def _fix_attribute_names(self, record: logging.LogRecord): """Transform record field names from camel case to underscored.""" for attribute, transform in self.RECORD_ATTRIBUTE_TRANSFORM: value = record.__getattribute__(attribute) record.__setattr__(transform, value) return record