This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author planders
Recipients planders
Date 2017-07-30.17:10:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1501434610.41.0.267137622883.issue31080@psf.upfronthosting.co.za>
In-reply-to
Content
The function `logging.config.fileConfig` accepts `args` but it would be nice if it also accepted `kwargs`.

A simple patch seems to do it:

	diff --git a/Lib/logging/config.py b/Lib/logging/config.py
	index d692514..4672b48 100644
	--- a/Lib/logging/config.py
	+++ b/Lib/logging/config.py
	@@ -145,7 +145,9 @@ def _install_handlers(cp, formatters):
				 klass = _resolve(klass)
			 args = section["args"]
			 args = eval(args, vars(logging))
	-        h = klass(*args)
	+        kwargs = section.get("kwargs", '{}')
	+        kwargs = eval(kwargs, vars(logging))
	+        h = klass(*args, **kwargs)
			 if "level" in section:
				 level = section["level"]
				 h.setLevel(level)


Unless there are any objections I plan to submit a pull request. In my use case I have a Pyramid service which
uses `concurrent-log-handler` and it seems better to be able to name keyword args for file configuration.
History
Date User Action Args
2017-07-30 17:10:10planderssetrecipients: + planders
2017-07-30 17:10:10planderssetmessageid: <1501434610.41.0.267137622883.issue31080@psf.upfronthosting.co.za>
2017-07-30 17:10:10planderslinkissue31080 messages
2017-07-30 17:10:10planderscreate