forked from github/pelican
readers: Add debugging logging to read_file
This commit is contained in:
parent
ecf5682930
commit
4e118eff01
1 changed files with 5 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals, print_function
|
||||
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
try:
|
||||
|
|
@ -35,6 +36,8 @@ from pelican.contents import Page, Category, Tag, Author
|
|||
from pelican.utils import get_date, pelican_open
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
METADATA_PROCESSORS = {
|
||||
'tags': lambda x, y: [Tag(tag, y) for tag in x.split(',')],
|
||||
'date': lambda x, y: get_date(x),
|
||||
|
|
@ -343,6 +346,8 @@ def read_file(base_path, path, content_class=Page, fmt=None,
|
|||
path = os.path.abspath(os.path.join(base_path, path))
|
||||
source_path = os.path.relpath(path, base_path)
|
||||
base, ext = os.path.splitext(os.path.basename(path))
|
||||
logger.debug('read file {} -> {}'.format(
|
||||
source_path, content_class.__name__))
|
||||
if not fmt:
|
||||
fmt = ext[1:]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue