Switch to vlogging.main_decorator.

This commit is contained in:
voussoir 2021-09-12 21:19:53 -07:00
parent a0f1b2d86d
commit 068775cedd
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -13,13 +13,6 @@ from voussoirkit import vlogging
import etiquette
LOG_LEVEL = vlogging.NOTSET
handler = vlogging.StreamHandler()
log_format = '{levelname}:etiquette.{module}.{funcName}: {message}'
handler.setFormatter(vlogging.Formatter(log_format, style='{'))
vlogging.getLogger().addHandler(handler)
photodbs = {}
def find_photodb():
@ -30,7 +23,7 @@ def find_photodb():
pass
# If this raises, main will catch it.
photodb = etiquette.photodb.PhotoDB.closest_photodb(cwd, log_level=LOG_LEVEL)
photodb = etiquette.photodb.PhotoDB.closest_photodb(cwd)
photodbs[cwd] = photodb
return photodb
@ -870,10 +863,8 @@ tag_list:
DOCSTRING = betterhelp.add_previews(DOCSTRING, SUB_DOCSTRINGS)
@vlogging.main_decorator
def main(argv):
global LOG_LEVEL
(LOG_LEVEL, argv) = vlogging.get_level_by_argv(argv)
parser = argparse.ArgumentParser(description=__doc__)
subparsers = parser.add_subparsers()