Skip to content

Commit d49f024

Browse files
committedNov 21, 2015
Revert "Go from INFO to NOTICE."
This reverts commit 4273b4a. cc @Aeyoun -- this was really fucked up, as a global solution for a local problem never works right.
1 parent 8f2fbd9 commit d49f024

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed
 

‎CHANGES.txt

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Features
99
Bugfixes
1010
--------
1111

12+
* Restored log level to INFO (it broke many messages)
1213
* Check HTTP response status of minifying tools and skip them if they’re unavailable
1314
* Change rewrite rule for fragment-only links (Issue #2132)
1415
* Mention disabled plugins in ``nikola plugin --list-installed`` (Issue #2139)

‎nikola/plugins/command/check.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def analyze(self, fname, find_sources=False, check_remote=False):
245245
target = urldefrag(target)[0]
246246

247247
if any([urlparse(target).netloc.endswith(_) for _ in ['example.com', 'example.net', 'example.org']]):
248-
self.logger.info("Not testing example address \"{0}\".".format(target))
248+
self.logger.debug("Not testing example address \"{0}\".".format(target))
249249
continue
250250

251251
# absolute URL to root-relative
@@ -274,7 +274,7 @@ def analyze(self, fname, find_sources=False, check_remote=False):
274274
if self.checked_remote_targets[target] in [301, 308]:
275275
self.logger.warn("Remote link PERMANENTLY redirected in {0}: {1} [Error {2}]".format(filename, target, self.checked_remote_targets[target]))
276276
elif self.checked_remote_targets[target] in [302, 307]:
277-
self.logger.notice("Remote link temporarily redirected in {1}: {2} [HTTP: {3}]".format(filename, target, self.checked_remote_targets[target]))
277+
self.logger.debug("Remote link temporarily redirected in {1}: {2} [HTTP: {3}]".format(filename, target, self.checked_remote_targets[target]))
278278
elif self.checked_remote_targets[target] > 399:
279279
self.logger.error("Broken link in {0}: {1} [Error {2}]".format(filename, target, self.checked_remote_targets[target]))
280280
continue
@@ -302,7 +302,7 @@ def analyze(self, fname, find_sources=False, check_remote=False):
302302
if redir_status_code in [301, 308]:
303303
self.logger.warn("Remote link moved PERMANENTLY to \"{0}\" and should be updated in {1}: {2} [HTTP: {3}]".format(resp.url, filename, target, redir_status_code))
304304
if redir_status_code in [302, 307]:
305-
self.logger.notice("Remote link temporarily redirected to \"{0}\" in {1}: {2} [HTTP: {3}]".format(resp.url, filename, target, redir_status_code))
305+
self.logger.debug("Remote link temporarily redirected to \"{0}\" in {1}: {2} [HTTP: {3}]".format(resp.url, filename, target, redir_status_code))
306306
self.checked_remote_targets[resp.url] = resp.status_code
307307
self.checked_remote_targets[target] = redir_status_code
308308
else:
@@ -343,7 +343,7 @@ def analyze(self, fname, find_sources=False, check_remote=False):
343343

344344
elif target_filename not in self.existing_targets:
345345
if os.path.exists(target_filename):
346-
self.logger.info(u"Good link {0} => {1}".format(target, target_filename))
346+
self.logger.notice(u"Good link {0} => {1}".format(target, target_filename))
347347
self.existing_targets.add(target_filename)
348348
else:
349349
rv = True
@@ -358,9 +358,9 @@ def analyze(self, fname, find_sources=False, check_remote=False):
358358

359359
def scan_links(self, find_sources=False, check_remote=False):
360360
"""Check links on the site."""
361-
self.logger.info("Checking Links:")
362-
self.logger.info("===============\n")
363-
self.logger.info("{0} mode".format(self.site.config['URL_TYPE']))
361+
self.logger.debug("Checking Links:")
362+
self.logger.debug("===============\n")
363+
self.logger.debug("{0} mode".format(self.site.config['URL_TYPE']))
364364
failure = False
365365
# Maybe we should just examine all HTML files
366366
output_folder = self.site.config['OUTPUT_FOLDER']
@@ -380,14 +380,14 @@ def scan_links(self, find_sources=False, check_remote=False):
380380
if self.analyze(fname, find_sources, False):
381381
failure = True
382382
if not failure:
383-
self.logger.info("All links checked.")
383+
self.logger.debug("All links checked.")
384384
return failure
385385

386386
def scan_files(self):
387387
"""Check files in the site, find missing and orphaned files."""
388388
failure = False
389-
self.logger.info("Checking Files:")
390-
self.logger.info("===============\n")
389+
self.logger.debug("Checking Files:")
390+
self.logger.debug("===============\n")
391391
only_on_output, only_on_input = real_scan_files(self.site, self.cache)
392392

393393
# Ignore folders
@@ -406,14 +406,14 @@ def scan_files(self):
406406
for f in only_on_input:
407407
self.logger.warn(f)
408408
if not failure:
409-
self.logger.info("All files checked.")
409+
self.logger.debug("All files checked.")
410410
return failure
411411

412412
def clean_files(self):
413413
"""Remove orphaned files."""
414414
only_on_output, _ = real_scan_files(self.site, self.cache)
415415
for f in only_on_output:
416-
self.logger.info('removed: {0}'.format(f))
416+
self.logger.debug('removed: {0}'.format(f))
417417
os.unlink(f)
418418

419419
# Find empty directories and remove them
@@ -425,7 +425,7 @@ def clean_files(self):
425425
for d in all_dirs:
426426
try:
427427
os.rmdir(d)
428-
self.logger.info('removed: {0}/'.format(d))
428+
self.logger.debug('removed: {0}/'.format(d))
429429
except OSError:
430430
pass
431431
return True

‎nikola/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def get_logger(name, handlers):
126126

127127

128128
STDERR_HANDLER = [ColorfulStderrHandler(
129-
level=logbook.NOTICE if not DEBUG else logbook.DEBUG,
129+
level=logbook.INFO if not DEBUG else logbook.DEBUG,
130130
format_string=u'[{record.time:%Y-%m-%dT%H:%M:%SZ}] {record.level_name}: {record.channel}: {record.message}'
131131
)]
132132

0 commit comments

Comments
 (0)
Please sign in to comment.