Fix etiquette_repl vlogging.

This commit is contained in:
voussoir 2021-09-15 22:42:13 -07:00
parent 93da1f32c7
commit 042fe4dd2f
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -1,9 +1,3 @@
import logging
handler = logging.StreamHandler()
log_format = '{levelname}:etiquette.{module}.{funcName}: {message}'
handler.setFormatter(logging.Formatter(log_format, style='{'))
logging.getLogger().addHandler(handler)
import argparse import argparse
import code import code
import sys import sys
@ -16,8 +10,6 @@ from voussoirkit import vlogging
import etiquette import etiquette
LOG_LEVEL = vlogging.NOTSET
def easytagger(): def easytagger():
while True: while True:
i = input('> ') i = input('> ')
@ -42,7 +34,7 @@ def erepl_argparse(args):
global P global P
try: try:
P = etiquette.photodb.PhotoDB.closest_photodb(pathclass.cwd(), log_level=LOG_LEVEL) P = etiquette.photodb.PhotoDB.closest_photodb(pathclass.cwd())
except etiquette.exceptions.NoClosestPhotoDB as exc: except etiquette.exceptions.NoClosestPhotoDB as exc:
pipeable.stderr(exc.error_message) pipeable.stderr(exc.error_message)
pipeable.stderr('Try `etiquette_cli.py init` to create the database.') pipeable.stderr('Try `etiquette_cli.py init` to create the database.')
@ -63,10 +55,8 @@ def erepl_argparse(args):
if interactive.getpermission(): if interactive.getpermission():
break break
@vlogging.main_decorator
def main(argv): def main(argv):
global LOG_LEVEL
(LOG_LEVEL, argv) = vlogging.get_level_by_argv(argv)
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('--exec', dest='exec_statement', default=None) parser.add_argument('--exec', dest='exec_statement', default=None)