Skip to content

Commit

Permalink
Add controller logs
Browse files Browse the repository at this point in the history
  • Loading branch information
daya0576 committed Oct 8, 2024
1 parent c09f835 commit e8a2ba6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions beaverhabits/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ async def fetch_user_timezone() -> None:


async def get_or_create_user_timezone() -> str:
logger.info("Getting user timezone...")
if timezone := app.storage.user.get(TIME_ZONE_KEY):
logger.info(f"User timezone from storage: {timezone}")
return timezone
Expand Down
4 changes: 3 additions & 1 deletion beaverhabits/views.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import datetime
import json
import random
import time
from typing import List

from fastapi import HTTPException
from nicegui import ui

from beaverhabits.logging import logger

from beaverhabits.app.db import User
from beaverhabits.storage import get_user_dict_storage, session_storage
from beaverhabits.storage.dict import DAY_MASK, DictHabitList
Expand Down Expand Up @@ -75,6 +76,7 @@ async def get_user_habit(user: User, habit_id: str) -> Habit:
async def get_or_create_user_habit_list(
user: User, days: List[datetime.date]
) -> HabitList:
logger.info("Getting user habit list")
habit_list = await get_user_habit_list(user)
if habit_list is not None:
return habit_list
Expand Down

0 comments on commit e8a2ba6

Please sign in to comment.