From: Python-37 <19404655+Python-37@users.noreply.github.com> Date: Wed, 1 Dec 2021 02:38:45 +0000 (+0800) Subject: Add note about `parse_*` function in options.py X-Git-Tag: v6.2.0b1~28^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3082%2Fhead;p=thirdparty%2Ftornado.git Add note about `parse_*` function in options.py --- diff --git a/tornado/options.py b/tornado/options.py index 993e673e7..78c7fd833 100644 --- a/tornado/options.py +++ b/tornado/options.py @@ -86,6 +86,12 @@ instances to define isolated sets of options, such as for subcommands. options.logging = None parse_command_line() +.. note:: + + `parse_command_line` or `parse_config_file` function should called after + logging configuration and user-defined command line flags using the + `callback` option definition, or these configurations will not take effect. + .. versionchanged:: 4.3 Dashes and underscores are fully interchangeable in option names; options can be defined, set, and read with any mix of the two. @@ -322,10 +328,6 @@ class OptionParser(object): Note that ``args[0]`` is ignored since it is the program name in `sys.argv`. - - Note that ``logging-related`` flags (such as ``log_to_stderr``, - ``log_file_prefix``) to options will not take effect if they - are setted after this line. We return a list of all arguments that are not parsed as options.