@@ -672,7 +672,8 @@ def configure_formatter(self, config):
672672 else :
673673 fmt = config .get ('format' , None )
674674 dfmt = config .get ('datefmt' , None )
675- result = logging .Formatter (fmt , dfmt )
675+ style = config .get ('style' , '%' )
676+ result = logging .Formatter (fmt , dfmt , style )
676677 return result
677678
678679 def configure_filter (self , config ):
@@ -694,6 +695,7 @@ def add_filters(self, filterer, filters):
694695
695696 def configure_handler (self , config ):
696697 """Configure a handler from a dictionary."""
698+ config_copy = dict (config ) # for restoring in case of error
697699 formatter = config .pop ('formatter' , None )
698700 if formatter :
699701 try :
@@ -717,7 +719,7 @@ def configure_handler(self, config):
717719 try :
718720 th = self .config ['handlers' ][config ['target' ]]
719721 if not isinstance (th , logging .Handler ):
720- config [ 'class' ] = cname # restore for deferred configuration
722+ config . update ( config_copy ) # restore for deferred cfg
721723 raise TypeError ('target not configured yet' )
722724 config ['target' ] = th
723725 except Exception as e :
0 commit comments