diff --git a/README.rst b/README.rst index 3ef863e..d1f14ad 100644 --- a/README.rst +++ b/README.rst @@ -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. diff --git a/nvchecker/core.py b/nvchecker/core.py index 069d162..cd6dd86 100644 --- a/nvchecker/core.py +++ b/nvchecker/core.py @@ -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',