From 46469f384a0ebe8433a6248b3d158e569ee74924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 5 Apr 2017 12:31:16 +0200 Subject: [PATCH] Set up logging when running from CLI. Logging is sent to stderr, so it shouldn't interfere with external programs expecting output on stdout. --- bam/cli.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bam/cli.py b/bam/cli.py index 66d45d8..2ff8a46 100755 --- a/bam/cli.py +++ b/bam/cli.py @@ -2015,6 +2015,11 @@ def main(argv=None): if argv is None: argv = sys.argv[1:] + logging.basicConfig( + level=logging.INFO, + format='%(asctime)-15s %(levelname)8s %(name)s %(message)s', + ) + parser = create_argparse() args = parser.parse_args(argv)