Teks sumber — English
Terjemahan — Bahasa Indonesia
Parameters
Parameter
Use of a configuration read from a file, and then modified by the using application (e.g. based on command-line parameters or other aspects of the runtime environment) before being passed to ``fileConfig``.
The logging configuration functionality tries to offer convenience, and in part this is done by offering the ability to convert text in configuration files into Python objects used in logging configuration - for example, as described in :ref:`logging-config-dict-userdef`. However, these same mechanisms (importing callables from user-defined modules and calling them with parameters from the configuration) could be used to invoke any code you like, and for this reason you should treat configuration files from untrusted sources with *extreme caution* and satisfy yourself that nothing bad can happen if you load them, before actually loading them.
Describing a logging configuration requires listing the various objects to create and the connections between them; for example, you may create a handler named 'console' and then say that the logger named 'startup' will send its messages to the 'console' handler. These objects aren't limited to those provided by the :mod:`logging` module because you might write your own formatter or handler class. The parameters to these classes may also need to include external objects such as ``sys.stderr``. The syntax for describing these objects and connections is defined in :ref:`logging-config-dict-connections` below.