json logging to stdout instead

This commit is contained in:
lilydjwg 2018-04-14 13:44:33 +08:00
parent 8b2c933d02
commit 7676628b57
1 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@ def add_common_arguments(parser):
help='select which logger to use')
parser.add_argument('--json-log-fd',
type=lambda fd: os.fdopen(int(fd), mode='w'),
help='specify fd to send json logs to. stderr by default')
help='specify fd to send json logs to. stdout by default')
parser.add_argument('-V', '--version', action='store_true',
help='show version and exit')
parser.add_argument('file', metavar='FILE', nargs='?', type=open,
@ -57,7 +57,7 @@ def process_common_arguments(args):
])
if logger_factory is None:
logfile = args.json_log_fd or sys.stderr
logfile = args.json_log_fd or sys.stdout
logger_factory = structlog.PrintLoggerFactory(file=logfile)
structlog.configure(