Skip to content

Commit

Permalink
Merge pull request #226 from ArtrenH/main
Browse files Browse the repository at this point in the history
improve logging
  • Loading branch information
Belissimo-T authored Nov 4, 2023
2 parents 056e116 + 17c228d commit 8ea3471
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions backend/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@


async def main():
logging.basicConfig(level=1, format="[%(asctime)s] [%(levelname)8s] %(name)s: %(message)s",
datefmt="%Y-%m-%d %H:%M:%S")

argparser = argparse.ArgumentParser()

subparsers = argparser.add_subparsers(dest="subcommand")
Expand All @@ -22,6 +19,9 @@ async def main():
crawlers = await get_crawlers(create_clients=False)

if args.subcommand == "migrate-all":
logging.basicConfig(level="DEBUG", format="[%(asctime)s] [%(levelname)8s] %(name)s: %(message)s",
datefmt="%Y-%m-%d %H:%M:%S")

for crawler in crawlers.values():
for day in crawler.plan_processor.cache.get_days():
crawler.plan_processor.cache.update_newest(day)
Expand All @@ -35,6 +35,9 @@ async def main():
crawler.plan_processor.store_teachers()

elif args.subcommand == "extract-all-teachers":
logging.basicConfig(level=1, format="[%(asctime)s] [%(levelname)8s] %(name)s: %(message)s",
datefmt="%Y-%m-%d %H:%M:%S")

for crawler in crawlers.values():
crawler.plan_processor._logger.info("Extracting teachers...")

Expand Down

0 comments on commit 8ea3471

Please sign in to comment.