Set up logging when running from CLI.
Logging is sent to stderr, so it shouldn't interfere with external programs expecting output on stdout.
This commit is contained in:
@@ -2015,6 +2015,11 @@ def main(argv=None):
|
|||||||
if argv is None:
|
if argv is None:
|
||||||
argv = sys.argv[1:]
|
argv = sys.argv[1:]
|
||||||
|
|
||||||
|
logging.basicConfig(
|
||||||
|
level=logging.INFO,
|
||||||
|
format='%(asctime)-15s %(levelname)8s %(name)s %(message)s',
|
||||||
|
)
|
||||||
|
|
||||||
parser = create_argparse()
|
parser = create_argparse()
|
||||||
args = parser.parse_args(argv)
|
args = parser.parse_args(argv)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user