minor usage update

This commit is contained in:
lilydjwg 2019-02-24 19:49:43 +08:00
parent 87a55c6cf9
commit 5a8577dec6
2 changed files with 2 additions and 2 deletions

View File

@ -86,7 +86,7 @@ You normally will like to specify some "version record files"; see below.
JSON logging
------------
With ``--logger=json`` or ``--logger=both``, you can get a structured logging
for programmatically consuming. You can use ``--json-log-fd=N`` to specify the
for programmatically consuming. You can use ``--json-log-fd=FD`` to specify the
file descriptor to send logs to (take care to do line buffering). The logging
level option (``-l`` or ``--logging``) doesn't take effect with this.

View File

@ -26,7 +26,7 @@ def add_common_arguments(parser):
parser.add_argument('--logger', default='pretty',
choices=['pretty', 'json', 'both'],
help='select which logger to use')
parser.add_argument('--json-log-fd',
parser.add_argument('--json-log-fd', metavar='FD',
type=lambda fd: os.fdopen(int(fd), mode='w'),
help='specify fd to send json logs to. stdout by default')
parser.add_argument('-V', '--version', action='store_true',