def configure_formatter(self, config):
if '<STR_LIT>' in config:<EOL><INDENT>factory = config['<STR_LIT>']  <EOL>try:<EOL><INDENT>result = self.configure_custom(config)<EOL><DEDENT>except TypeError as te:<EOL><INDENT>if "<STR_LIT>" not in str(te):<EOL><INDENT>raise<EOL><DEDENT>config['<STR_LIT>'] = config.pop('<STR_LIT>')<EOL>config['<STR_LIT>'] = factory<EOL>result = self.configure_custom(config)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>fmt = config.get('<STR_LIT>', None)<EOL>dfmt = config.get('<STR_LIT>', None)<EOL>result = logging.Formatter(fmt, dfmt)<EOL><DEDENT>return result<EOL>
Configure a formatter from a dictionary.