Add warnings flag

This commit adds a warnings flag

It can be combined with -q / --quiet to display warnings.
The intent is to provide a silent option that still surfaces
warning and error messages so that they are visible in logs.
pull/5474/head
Aidan Harris 5 months ago
parent 0d72789aa3
commit a3f580254a
No known key found for this signature in database
GPG Key ID: E18BE27807DA2E96

@ -113,7 +113,7 @@ def main():
# loglevels
output.configure_logging(args.loglevel)
if args.loglevel >= logging.ERROR:
if args.loglevel >= logging.WARNING:
config.set(("output",), "mode", "null")
config.set(("downloader",), "progress", None)
elif args.loglevel <= logging.DEBUG:

@ -255,6 +255,12 @@ def build_parser():
action="store_const", const=logging.DEBUG,
help="Print various debugging information",
)
output.add_argument(
"-w", "--warning",
dest="loglevel",
action="store_const", const=logging.WARNING,
help="Print warnings",
)
output.add_argument(
"-g", "--get-urls",
dest="list_urls", action="count",

Loading…
Cancel
Save