1- # Copyright 2001-2019 by Vinay Sajip. All Rights Reserved.
1+ # Copyright 2001-2023 by Vinay Sajip. All Rights Reserved.
22#
33# Permission to use, copy, modify, and distribute this software and its
44# documentation for any purpose and without fee is hereby granted,
1919is based on PEP 282 and comments thereto in comp.lang.python, and influenced
2020by Apache's log4j system.
2121
22- Copyright (C) 2001-2019 Vinay Sajip. All Rights Reserved.
22+ Copyright (C) 2001-2023 Vinay Sajip. All Rights Reserved.
2323
2424To use, simply 'import logging' and log away!
2525"""
@@ -477,10 +477,10 @@ def configure_custom(self, config):
477477 c = config .pop ('()' )
478478 if not callable (c ):
479479 c = self .resolve (c )
480- props = config .pop ('.' , None )
481480 # Check for valid identifiers
482- kwargs = {k : config [k ] for k in config if valid_ident (k )}
481+ kwargs = {k : config [k ] for k in config if ( k != '.' and valid_ident (k ) )}
483482 result = c (** kwargs )
483+ props = config .pop ('.' , None )
484484 if props :
485485 for name , value in props .items ():
486486 setattr (result , name , value )
@@ -752,8 +752,7 @@ def configure_handler(self, config):
752752 'address' in config :
753753 config ['address' ] = self .as_tuple (config ['address' ])
754754 factory = klass
755- props = config .pop ('.' , None )
756- kwargs = {k : config [k ] for k in config if valid_ident (k )}
755+ kwargs = {k : config [k ] for k in config if (k != '.' and valid_ident (k ))}
757756 try :
758757 result = factory (** kwargs )
759758 except TypeError as te :
@@ -771,6 +770,7 @@ def configure_handler(self, config):
771770 result .setLevel (logging ._checkLevel (level ))
772771 if filters :
773772 self .add_filters (result , filters )
773+ props = config .pop ('.' , None )
774774 if props :
775775 for name , value in props .items ():
776776 setattr (result , name , value )
0 commit comments