Added pro / con bullets to the list of ways to configure a logger

This commit is contained in:
Tanya Schlusser
2015-01-17 21:09:52 -06:00
parent 1cfb637cb1
commit 0c1551ae85
+14 -3
View File
@@ -82,9 +82,20 @@ application environment.
There are at least three ways to configure a logger:
- using a file
- using a dictionary
- using code
- Using an INI-formatted file:
- *Pro* -- possible to update configuration while running
using the function :func:`logging.config.listen` to listen
on a socket.
- *Con* -- less control (*e.g.* custom subclassed filters or loggers)
than possible when configuring a logger in code.
- Using a dictionary or a JSON-formatted file:
- *Pro* -- in addition to updating while running, it is possible to
load from a file using the :mod:`json` module, in the standard
library since Python 2.6.
- *Con* -- less control than when configuring a logger in code.
- Using code:
- *Pro* -- complete control over the configuration.
- *Con* -- modifications require a change to source code.
Example Configuration via an INI File