Skip to content

Commit

Permalink
mood logs.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhrumilp12 committed Jun 21, 2024
1 parent a13f6d0 commit 4223722
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions server/routes/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,13 @@ def log_mood():
if not mood or not activities:
return jsonify({"message": "Missing data for mood or activities"}), 400

# Example logging statement using datetime correctly
logging.info(f"Logging mood for {current_user} at {datetime.now()}")

mood_log.log_user_mood(current_user, mood, activities)
return jsonify({"message": "Mood logged successfully"}), 200

# Example logging statement using datetime correctly
logging.info(f"Logging mood for {current_user} at {datetime.now()}")


except Exception as e:
logging.error(f"Error logging mood: {str(e)}")
Expand Down
2 changes: 1 addition & 1 deletion server/services/db/mood_log.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging
import datetime
from datetime import datetime
from pymongo.errors import PyMongoError

from services.azure_mongodb import MongoDBClient
Expand Down

0 comments on commit 4223722

Please sign in to comment.