Skip to content

Commit

Permalink
fix log format
Browse files Browse the repository at this point in the history
  • Loading branch information
fanglinfang committed Aug 11, 2023
1 parent 4dcbd84 commit 7d6ca50
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions myuw/management/commands/db_cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ def course_display(self):
"{} Delete Batch {}:{}:{} {}\n".format(
"UserCourseDisplay", y, q, c, ex))
raise CommandError(ex)
logger.info("UserCourseDisplay delete {} {} Time: {}\n",
y, q, timer.get_elapsed())
logger.info(
"UserCourseDisplay delete {} {} Time: {} seconds\n".format(
y, q, timer.get_elapsed()
))

def notice_read(self):
# clean up after 180 days
Expand All @@ -94,8 +96,8 @@ def notice_read(self):
except Exception as ex:
logger.error("UserNotices delete {}\n".format(ex))
raise CommandError(ex)
logger.info("UserNotices Delete viewed before {} Time: {}\n",
cut_off_dt, timer.get_elapsed())
logger.info("UserNotices Delete viewed before {} Time: {}\n".format(
cut_off_dt, timer.get_elapsed()))

def registration_seen(self):
# clean up after the quarter ends
Expand All @@ -115,8 +117,8 @@ def registration_seen(self):
except Exception as ex:
logger.error("SeenRegistration delete {}\n".format(ex))
raise CommandError(ex)
logger.info("SeenRegistration Delete {} {} Time: {}\n",
y, q, timer.get_elapsed())
logger.info("SeenRegistration Delete {} {} Time: {}\n".format(
y, q, timer.get_elapsed()))

def link_visited(self):
# clean up after one year
Expand All @@ -133,5 +135,6 @@ def link_visited(self):
except Exception as ex:
logger.error("VisitedLinkNew delelte {}\n".format(ex))
raise CommandError(ex)
logger.info("VisitedLinkNew Delete viewed before {} Time: {}\n",
cut_off_dt, timer.get_elapsed())
logger.info(
"VisitedLinkNew Delete viewed before {} Time: {}\n".format(
cut_off_dt, timer.get_elapsed()))

0 comments on commit 7d6ca50

Please sign in to comment.