Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change some info logging to debug to clean up build output #5233

Merged
merged 2 commits into from
Feb 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions readthedocs/core/symlink.py
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the most important, as they are currently spamming our build logs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was added because we were experimenting some issues while posting big outputs. That is working fine now and I think the logs are not more necessary. 👍 on .debug it.



class DockerBuildCommand(BuildCommand):
Expand Down
16 changes: 8 additions & 8 deletions readthedocs/vcs_support/utils.py
Original file line number Diff line number Diff line change
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