forked from github/pelican
change the way logging is done, using the standard log tree instead of
calling the module-level functions on an unitialised logging object. This allows to - simplify log.py - use one logger object for each file
This commit is contained in:
parent
7fcfea647f
commit
0922efa371
7 changed files with 79 additions and 65 deletions
|
|
@ -1,16 +1,20 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import with_statement
|
||||
|
||||
import os
|
||||
import re
|
||||
import locale
|
||||
import logging
|
||||
|
||||
from codecs import open
|
||||
from functools import partial
|
||||
import locale
|
||||
import re
|
||||
|
||||
from feedgenerator import Atom1Feed, Rss201rev2Feed
|
||||
from pelican.paginator import Paginator
|
||||
from pelican.log import info
|
||||
from pelican.utils import get_relative_path, set_date_tzinfo
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Writer(object):
|
||||
|
||||
|
|
@ -73,7 +77,7 @@ class Writer(object):
|
|||
pass
|
||||
fp = open(complete_path, 'w')
|
||||
feed.write(fp, 'utf-8')
|
||||
info('writing %s' % complete_path)
|
||||
logger.info('writing %s' % complete_path)
|
||||
|
||||
fp.close()
|
||||
return feed
|
||||
|
|
@ -108,7 +112,7 @@ class Writer(object):
|
|||
pass
|
||||
with open(filename, 'w', encoding='utf-8') as f:
|
||||
f.write(output)
|
||||
info(u'writing %s' % filename)
|
||||
logger.info(u'writing %s' % filename)
|
||||
|
||||
localcontext = context.copy()
|
||||
if relative_urls:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue