Skip to content

Commit af94f4e

Browse files
committed
debug logs for runtime build dir create/update
1 parent b33a577 commit af94f4e

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

docs/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ RUN sphinx-build -b html docs/source docs/build
4040
# Define Entrypoint
4141
# -----------------
4242
ENV PORT 5000
43+
ENV IDOM_DEBUG_MODE=1
4344
CMD python docs/main.py

src/idom/client/_private.py

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
import logging
23
import re
34
import shutil
45
from os.path import getmtime
@@ -8,6 +9,8 @@
89
from idom.config import IDOM_CLIENT_BUILD_DIR
910

1011

12+
logger = logging.getLogger()
13+
1114
HERE = Path(__file__).parent
1215
APP_DIR = HERE / "app"
1316
BACKUP_BUILD_DIR = APP_DIR / "build"
@@ -19,10 +22,12 @@
1922
def _run_build_dir_init_only_once() -> None: # pragma: no cover
2023
"""Initialize the runtime build directory - this should only be called once"""
2124
if not IDOM_CLIENT_BUILD_DIR.current.exists():
25+
logger.debug("creating new runtime build directory")
2226
IDOM_CLIENT_BUILD_DIR.current.parent.mkdir(parents=True, exist_ok=True)
2327
# populate the runtime build directory if it doesn't exist
2428
shutil.copytree(BACKUP_BUILD_DIR, IDOM_CLIENT_BUILD_DIR.current, symlinks=True)
2529
elif getmtime(BACKUP_BUILD_DIR) > getmtime(IDOM_CLIENT_BUILD_DIR.current):
30+
logger.debug("updating runtime build directory because it is out of date")
2631
# delete the existing runtime build because it's out of date
2732
shutil.rmtree(IDOM_CLIENT_BUILD_DIR.current)
2833
# replace it with the newer backup build (presumable from a fresh install)

src/idom/client/app/package-lock.json

+1-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)