Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshimizukawa <shimizukawa@gmail.com>2020-05-30 21:06:44 +0300
committershimizukawa <shimizukawa@gmail.com>2020-06-13 18:05:33 +0300
commit2953eb81043208ebcf4cc714c57f42ea002ee6e5 (patch)
tree4d212b55880cad5203179f3ba95da0a1916c4cf1 /sphinx/environment
parentba93a41a728775ed86660f83387ecb4eca006bed (diff)
add debug logs for change detection: added/changed/outdated, mtime of sources and templates
Diffstat (limited to 'sphinx/environment')
-rw-r--r--sphinx/environment/__init__.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/sphinx/environment/__init__.py b/sphinx/environment/__init__.py
index d786decc8..9451d1451 100644
--- a/sphinx/environment/__init__.py
+++ b/sphinx/environment/__init__.py
@@ -12,6 +12,7 @@ import os
import pickle
from collections import defaultdict
from copy import copy
+from datetime import datetime
from os import path
from typing import Any, Callable, Dict, Generator, Iterator, List, Set, Tuple, Union
from typing import TYPE_CHECKING
@@ -391,21 +392,28 @@ class BuildEnvironment:
else:
for docname in self.found_docs:
if docname not in self.all_docs:
+ logger.debug('[build target] added %r', docname)
added.add(docname)
continue
# if the doctree file is not there, rebuild
filename = path.join(self.doctreedir, docname + '.doctree')
if not path.isfile(filename):
+ logger.debug('[build target] changed %r', docname)
changed.add(docname)
continue
# check the "reread always" list
if docname in self.reread_always:
+ logger.debug('[build target] changed %r', docname)
changed.add(docname)
continue
# check the mtime of the document
mtime = self.all_docs[docname]
newmtime = path.getmtime(self.doc2path(docname))
if newmtime > mtime:
+ logger.debug('[build target] outdated %r: %s -> %s',
+ docname,
+ datetime.utcfromtimestamp(mtime),
+ datetime.utcfromtimestamp(newmtime))
changed.add(docname)
continue
# finally, check the mtime of dependencies