-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d2556e
commit 2120cf8
Showing
4 changed files
with
50 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
02-08 22:52 root INFO Running Fitness-Tracker/src/model/model.py ... | ||
02-08 22:52 model.area1 INFO data_model: real | ||
02-08 22:52 model.area1 DEBUG db: <TinyDB tables=['weight_training_log'], tables_count=1, default_table_documents_count=0, all_tables_documents_count=['weight_training_log=127']> | ||
02-08 22:52 model.area1 DEBUG table: <Table name='weight_training_log', total=127, storage=<tinydb.storages.JSONStorage object at 0x10d167c90>> | ||
02-08 22:52 model.area2 INFO Exercise: squat | ||
02-08 22:52 model.area2 INFO Workout timestamps: [1639177200.0, 1640386800.0, 1640991600.0, 1642201200.0, 1643238000.0, 1644015600.0, 1644620400.0, 1645830000.0, 1646434800.0, 1647212400.0, 1648504800.0, 1649628000.0, 1650319200.0, 1651183200.0, 1651874400.0, 1652479200.0, 1652997600.0, 1653688800.0, 1655416800.0, 1656280800.0, 1656712800.0, 1657576800.0, 1658008800.0, 1658354400.0, 1658959200.0, 1660600800.0, 1661464800.0, 1662760800.0, 1663279200.0, 1663711200.0, 1673564400.0, 1674342000.0, 1674946800.0, 1675724400.0] | ||
02-08 22:52 model.area2 INFO 1 RM estimates: [102.86, 91.43, 102.86, 108.11, 108.11, 108.11, 108.11, 108.11, 114.29, 114.29, 117.65, 117.65, 117.65, 117.65, 117.65, 125.0, 125.0, 125.0, 133.33, 121.21, 53.33, 60.0, 66.67, 73.33, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 91.43, 91.43, 91.43, 91.43] | ||
02-08 22:52 model.area2 INFO Volume: [2880.0, 1600.0, 1800.0, 2000.0, 2000.0, 2000.0, 3200.0, 4000.0, 2400.0, 3200.0, 3200.0, 2400.0, 3000.0, 3000.0, 3600.0, 2400.0, 3000.0, 3000.0, 1440.0, 2400.0, 4000.0, 4500.0, 5000.0, 5500.0, 6000.0, 6000.0, 6000.0, 6000.0, 6000.0, 6000.0, 1200.0, 1200.0, 1200.0, 1200.0] | ||
09-23 13:39 root INFO Logger initialized | ||
09-23 13:39 root INFO Running fitness-tracker/src/model/model.py ... | ||
09-23 13:39 model.area1 INFO data_model: real | ||
09-23 13:39 model.area1 DEBUG db: <TinyDB tables=['weight_training_log'], tables_count=1, default_table_documents_count=0, all_tables_documents_count=['weight_training_log=52']> | ||
09-23 13:39 model.area1 DEBUG table: <Table name='weight_training_log', total=52, storage=<custom_storage.YAMLStorage object at 0x12e569e10>> | ||
09-23 13:39 model.area2 INFO Exercise: squat | ||
09-23 13:39 model.area2 INFO Workout timestamps: [1704992400.0, 1706288400.0, 1708189200.0, 1708794000.0, 1709917200.0, 1711213200.0, 1711731600.0, 1712854800.0, 1714842000.0, 1718211600.0, 1720198800.0, 1720630800.0, 1721149200.0, 1722358800.0, 1723222800.0, 1725728400.0] | ||
09-23 13:39 model.area2 INFO 1 RM estimates: [87.5, 87.5, 87.5, 93.33, 87.5, 120.0, 85.71, 81.25, 80.0, 85.71, 87.5, 50.0, 87.5, 68.75, 120.0, 75.0] | ||
09-23 13:39 model.area2 INFO Volume: [1680.0, 1680.0, 1680.0, 2100.0, 1680.0, 3240.0, 2160.0, 1560.0, 1800.0, 2160.0, 1680.0, 960.0, 1680.0, 1650.0, 2700.0, 1620.0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import logging | ||
from pathlib import Path | ||
|
||
|
||
def setup_logger(log_file: str = "insert.log", log_dir: str = "logs/"): | ||
# Create the log directory if it doesn't exist | ||
Path(log_dir).mkdir(parents=True, exist_ok=True) | ||
|
||
# Configure the logging | ||
logging.basicConfig( | ||
level=logging.DEBUG, | ||
format="%(asctime)s %(name)-12s %(levelname)-8s %(message)s", | ||
datefmt="%m-%d %H:%M", | ||
filename=f"{log_dir}/{log_file}", | ||
filemode="w", | ||
) | ||
|
||
# Console handler for the logger | ||
console = logging.StreamHandler() | ||
console.setLevel(logging.INFO) | ||
formatter = logging.Formatter("%(name)-12s: %(levelname)-8s %(message)s") | ||
console.setFormatter(formatter) | ||
|
||
# Add console handler to the root logger | ||
logging.getLogger("").addHandler(console) | ||
|
||
logging.info("Logger initialized") | ||
|
||
|
||
def log_running_file(file_path): | ||
"""Optional utility for logging the running file.""" | ||
logging.info("Running %s ...", "/".join(file_path.split("/")[-4:])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters