Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit 22d1b65

Browse files
committed
use logging instead of print
1 parent dd3da7a commit 22d1b65

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

migrate_timeseries.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import logging
12
import os
23

34
import django
@@ -9,11 +10,13 @@
910

1011
from django.conf import settings # noqa: E402
1112

13+
logger = logging.getLogger(__name__)
14+
1215

1316
def run_migrate_commands():
1417
try:
1518
if settings.TA_TIMESERIES_ENABLED:
16-
print("Running ta_timeseries migrations")
19+
logger.info("Running ta_timeseries migrations")
1720
call_command(
1821
"migrate",
1922
database="ta_timeseries",
@@ -22,10 +25,10 @@ def run_migrate_commands():
2225
verbosity=1,
2326
)
2427
else:
25-
print("Skipping ta_timeseries migrations")
28+
logger.info("Skipping ta_timeseries migrations")
2629

2730
except Exception as e:
28-
print(f"An error occurred: {e}")
31+
logger.error(f"An error occurred: {e}")
2932

3033

3134
if __name__ == "__main__":

0 commit comments

Comments
 (0)