From 81d09ad3bc0583fd8511d7bdb6fc24aedf0edfad Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Mon, 21 Jun 2021 21:54:42 -0700 Subject: [PATCH] Add vlogging.main_decorator to reduce application boilerplate. --- voussoirkit/vlogging.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/voussoirkit/vlogging.py b/voussoirkit/vlogging.py index fadc549..94fb0f5 100644 --- a/voussoirkit/vlogging.py +++ b/voussoirkit/vlogging.py @@ -105,6 +105,12 @@ def get_level_by_name(name): return value +def main_decorator(main): + def wrapped(argv): + argv = main_level_by_argv(argv) + return main(argv) + return wrapped + def main_level_by_argv(argv): ''' This function puts a handler on the root logger with a level set by the