Skip to content

Commit

Permalink
Merge pull request #5233 from rtfd/reduce-build-logging
Browse files Browse the repository at this point in the history
Change some info logging to debug to clean up build output
  • Loading branch information
ericholscher committed Feb 11, 2019
2 parents cb1f941 + 39ae5f4 commit 20a9d28
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
10 changes: 5 additions & 5 deletions readthedocs/core/symlink.py
Expand Up @@ -158,7 +158,7 @@ def symlink_cnames(self, domain=None):
dom,
self.project.slug,
)
log.info(
log.debug(
constants.LOG_TEMPLATE.format(
project=self.project.slug,
version='',
Expand Down Expand Up @@ -190,7 +190,7 @@ def remove_symlink_cname(self, domain):
:type domain: str
"""
log_msg = 'Removing symlink for CNAME {}'.format(domain)
log.info(
log.debug(
constants.LOG_TEMPLATE.format(
project=self.project.slug,
version='',
Expand Down Expand Up @@ -225,7 +225,7 @@ def symlink_subprojects(self):
from_slug,
to_slug,
)
log.info(
log.debug(
constants.LOG_TEMPLATE.format(
project=self.project.slug,
version='',
Expand Down Expand Up @@ -279,7 +279,7 @@ def symlink_translations(self):
for (language, slug) in list(translations.items()):

log_msg = 'Symlinking translation: {}->{}'.format(language, slug)
log.info(
log.debug(
constants.LOG_TEMPLATE.format(
project=self.project.slug,
version='',
Expand Down Expand Up @@ -348,7 +348,7 @@ def symlink_versions(self):
safe_makedirs(version_dir)
for version in version_queryset:
log_msg = 'Symlinking Version: {}'.format(version)
log.info(
log.debug(
constants.LOG_TEMPLATE.format(
project=self.project.slug,
version='',
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/doc_builder/base.py
Expand Up @@ -66,7 +66,7 @@ def move(self, **__):
if os.path.exists(self.target):
shutil.rmtree(self.target)
log.info('Copying %s on the local filesystem', self.type)
log.info('Ignoring patterns %s', self.ignore_patterns)
log.debug('Ignoring patterns %s', self.ignore_patterns)
shutil.copytree(
self.old_artifact_path,
self.target,
Expand Down
4 changes: 2 additions & 2 deletions readthedocs/doc_builder/environments.py
Expand Up @@ -282,10 +282,10 @@ def save(self):
'Content-Type': encoder.content_type,
}
)
log.info('Post response via multipart form: %s', resp)
log.debug('Post response via multipart form: %s', resp)
else:
resp = api_v2.command.post(data)
log.info('Post response via JSON encoded data: %s', resp)
log.debug('Post response via JSON encoded data: %s', resp)


class DockerBuildCommand(BuildCommand):
Expand Down
16 changes: 8 additions & 8 deletions readthedocs/vcs_support/utils.py
Expand Up @@ -40,35 +40,35 @@ def __enter__(self):
while os.path.exists(self.fpath):
lock_age = time.time() - os.stat(self.fpath)[stat.ST_MTIME]
if lock_age > self.timeout:
log.info(
log.debug(
'Lock (%s): Force unlock, old lockfile',
self.name,
)
os.remove(self.fpath)
break
log.info('Lock (%s): Locked, waiting..', self.name)
log.debug('Lock (%s): Locked, waiting..', self.name)
time.sleep(self.polling_interval)
timesince = time.time() - start
if timesince > self.timeout:
log.info(
log.debug(
'Lock (%s): Force unlock, timeout reached',
self.name,
)
os.remove(self.fpath)
break
log.info(
log.debug(
'%s still locked after %.2f seconds; retry for %.2f'
' seconds',
self.name,
timesince,
self.timeout,
)
open(self.fpath, 'w').close()
log.info('Lock (%s): Lock acquired', self.name)
log.debug('Lock (%s): Lock acquired', self.name)

def __exit__(self, exc, value, tb):
try:
log.info('Lock (%s): Releasing', self.name)
log.debug('Lock (%s): Releasing', self.name)
os.remove(self.fpath)
except OSError as e:
# We want to ignore "No such file or directory" and log any other
Expand Down Expand Up @@ -107,7 +107,7 @@ def __enter__(self):
if path_exists and self.max_lock_age is not None:
lock_age = time.time() - os.stat(self.fpath)[stat.ST_MTIME]
if lock_age > self.max_lock_age:
log.info(
log.debug(
'Lock (%s): Force unlock, old lockfile',
self.name,
)
Expand All @@ -123,7 +123,7 @@ def __enter__(self):

def __exit__(self, exc_type, exc_val, exc_tb):
try:
log.info('Lock (%s): Releasing', self.name)
log.debug('Lock (%s): Releasing', self.name)
os.remove(self.fpath)
except (IOError, OSError) as e:
# We want to ignore "No such file or directory" and log any other
Expand Down

0 comments on commit 20a9d28

Please sign in to comment.