WAF_PRINT_FAILURE_LOG #1930

This commit is contained in:
Thomas Nagy 2017-07-20 19:26:22 +02:00
parent 8fedfef8a3
commit 12fb29e8a5
No known key found for this signature in database
GPG Key ID: 49B4C67C05277AAA
1 changed files with 7 additions and 1 deletions

View File

@ -489,9 +489,15 @@ class Context(ctx):
if self.logger:
self.logger.info('from %s: %s' % (self.path.abspath(), msg))
try:
msg = '%s\n(complete log in %s)' % (msg, self.logger.handlers[0].baseFilename)
logfile = self.logger.handlers[0].baseFilename
except AttributeError:
pass
else:
if os.environ.get('WAF_PRINT_FAILURE_LOG'):
# see #1930
msg = 'Log from (%s):\n%s\n' % (logfile, Utils.readf(logfile))
else:
msg = '%s\n(complete log in %s)' % (msg, logfile)
raise self.errors.ConfigurationError(msg, ex=ex)
def to_log(self, msg):