@@ -669,7 +669,8 @@ def configure_formatter(self, config):
669669 else :
670670 fmt = config .get ('format' , None )
671671 dfmt = config .get ('datefmt' , None )
672- result = logging .Formatter (fmt , dfmt )
672+ style = config .get ('style' , '%' )
673+ result = logging .Formatter (fmt , dfmt , style )
673674 return result
674675
675676 def configure_filter (self , config ):
@@ -691,6 +692,7 @@ def add_filters(self, filterer, filters):
691692
692693 def configure_handler (self , config ):
693694 """Configure a handler from a dictionary."""
695+ config_copy = dict (config ) # for restoring in case of error
694696 formatter = config .pop ('formatter' , None )
695697 if formatter :
696698 try :
@@ -714,7 +716,7 @@ def configure_handler(self, config):
714716 try :
715717 th = self .config ['handlers' ][config ['target' ]]
716718 if not isinstance (th , logging .Handler ):
717- config [ 'class' ] = cname # restore for deferred configuration
719+ config . update ( config_copy ) # restore for deferred cfg
718720 raise TypeError ('target not configured yet' )
719721 config ['target' ] = th
720722 except Exception as e :
0 commit comments