diff --git a/body_weight_history.db b/body_weight_history.db index 659a8f7..dfa4485 100644 Binary files a/body_weight_history.db and b/body_weight_history.db differ diff --git a/calorie_history_graph.jpg b/calorie_history_graph.jpg index 1781adb..3d3e68c 100644 Binary files a/calorie_history_graph.jpg and b/calorie_history_graph.jpg differ diff --git a/calories_spent.db b/calories_spent.db index def1946..98f78e9 100644 Binary files a/calories_spent.db and b/calories_spent.db differ diff --git a/food_data.db b/food_data.db index 4697ce7..cfb9a91 100644 Binary files a/food_data.db and b/food_data.db differ diff --git a/history.db b/history.db index b65d133..6872e0e 100644 Binary files a/history.db and b/history.db differ diff --git a/meal_history.db b/meal_history.db index b9476b8..d049d8d 100644 Binary files a/meal_history.db and b/meal_history.db differ diff --git a/meal_history.db-journal b/meal_history.db-journal deleted file mode 100644 index be573c0..0000000 Binary files a/meal_history.db-journal and /dev/null differ diff --git a/scale_gui.py b/scale_gui.py index 6390279..6b7f105 100755 --- a/scale_gui.py +++ b/scale_gui.py @@ -14,6 +14,7 @@ # create logger logger = logging.getLogger('scaleLogger') +logger.setLevel(logging.DEBUG) import cProfile @@ -696,6 +697,7 @@ def add_to_history(self): print(fooddata_db_id, foodcode, foodname, weight, calories) if fooddata_db_id !=0: + logger.debug(f"Food data being gathered for {fooddata_db_id}") part_data = self.food_data_db_con.execute( "SELECT id, FoodCode, FoodName, PROT, FAT, CHO, CHOL, TOTSUG, AOACFIB FROM FoodData WHERE id = ?", (fooddata_db_id,)) @@ -739,12 +741,14 @@ def add_to_history(self): logger.info(f'Meal History Add -->weight {weight}g protein {tot_protein}g, fat {tot_fat}g, ' f'carbs {tot_cho}g, chol {tot_chol}g, sugar {tot_sug}g, aoacfib {tot_aoacfib}') - self.meal_history_db_con.execute('INSERT INTO MealHistory (unix_ms, Date, fooddata_db_id, FoodName, ' - 'PROT, FAT, CHO, CHOL, TOTSUG, AOACFIB, KCALS, WEIGHT) ' - 'values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', - [now_micro, now, fooddata_db_id, foodname, - tot_protein, tot_fat, tot_cho, tot_chol, - tot_sug, tot_aoacfib, calories, weight]) + ret = self.meal_history_db_con.execute('INSERT INTO MealHistory (unix_ms, Date, fooddata_db_id, FoodName,' + 'PROT, FAT, CHO, CHOL, TOTSUG, AOACFIB, KCALS, WEIGHT) ' + ' values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', + [now_micro, now, fooddata_db_id, foodname, + tot_protein, tot_fat, tot_cho, tot_chol, + tot_sug, tot_aoacfib, calories, weight]) + logger.info(f'sql return {ret}') + self.meal_history_db_con.commit() if self.meal_total_calories != 0: with self.history_db_con: diff --git a/weight_history_graph.jpg b/weight_history_graph.jpg index 8a30341..b28c01d 100644 Binary files a/weight_history_graph.jpg and b/weight_history_graph.jpg differ