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.
This commit is contained in:
@@ -113,7 +113,7 @@ def main():
|
|||||||
|
|
||||||
# loglevels
|
# loglevels
|
||||||
output.configure_logging(args.loglevel)
|
output.configure_logging(args.loglevel)
|
||||||
if args.loglevel >= logging.ERROR:
|
if args.loglevel >= logging.WARNING:
|
||||||
config.set(("output",), "mode", "null")
|
config.set(("output",), "mode", "null")
|
||||||
config.set(("downloader",), "progress", None)
|
config.set(("downloader",), "progress", None)
|
||||||
elif args.loglevel <= logging.DEBUG:
|
elif args.loglevel <= logging.DEBUG:
|
||||||
|
|||||||
@@ -255,6 +255,12 @@ def build_parser():
|
|||||||
action="store_const", const=logging.DEBUG,
|
action="store_const", const=logging.DEBUG,
|
||||||
help="Print various debugging information",
|
help="Print various debugging information",
|
||||||
)
|
)
|
||||||
|
output.add_argument(
|
||||||
|
"-w", "--warning",
|
||||||
|
dest="loglevel",
|
||||||
|
action="store_const", const=logging.WARNING,
|
||||||
|
help="Print warnings",
|
||||||
|
)
|
||||||
output.add_argument(
|
output.add_argument(
|
||||||
"-g", "--get-urls",
|
"-g", "--get-urls",
|
||||||
dest="list_urls", action="count",
|
dest="list_urls", action="count",
|
||||||
|
|||||||
Reference in New Issue
Block a user