If I do logger.info('Parameters: %r' % parameters) then nothing gets logged and I get the following error:
raise BulkIndexError('%i document(s) failed to index.' % len(errors), errors)
'error': {
'type': 'mapper_parsing_exception',
'reason': 'failed to parse field [args] of type [text]',
'caused_by': {'type': 'illegal_state_exception', 'reason': "Can't get text on a START_OBJECT at 1:610"}
}
I switched to logger.info('Parameters: %s' % repr(parameters)) and that works fine, however it would be nice to be able to use %r and avoid wrapping parameters in repr().
I have recently switched to using
CMRESHandler
and I encoutered some issues when trying to use%r
for string formatting.The handler is set up as below:
Assuming I have the following dictionary to log:
If I do
logger.info('Parameters: %r' % parameters)
then nothing gets logged and I get the following error:I switched to
logger.info('Parameters: %s' % repr(parameters))
and that works fine, however it would be nice to be able to use%r
and avoid wrappingparameters
inrepr()
.