Changeset 267023 in webkit
- Timestamp:
- Sep 14, 2020 10:58:51 AM (4 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r267022 r267023 1 2020-09-14 Jonathan Bedard <jbedard@apple.com> 2 3 [webkitcorepy] Log autoinstall details even without a logger configured 4 https://bugs.webkit.org/show_bug.cgi?id=216480 5 6 Reviewed by Dewei Zhu. 7 8 * Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py: Bump version. 9 * Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py: 10 (Package.install): Use AutoInstall.log instead of logging. 11 (AutoInstall): 12 (AutoInstall.log): Check log to see if a logger is configured, if one is not, 13 output the message to stderr instead. 14 1 15 2020-09-14 Aakash Jain <aakash_jain@apple.com> 2 16 -
trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py
r267019 r267023 36 36 from webkitcorepy.output_capture import LoggerCapture, OutputCapture, OutputDuplicate 37 37 38 version = Version(0, 4, 8)38 version = Version(0, 4, 9) 39 39 40 40 from webkitcorepy.autoinstall import Package, AutoInstall -
trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py
r267019 r267023 22 22 23 23 import json 24 import logging 24 25 import math 25 26 import os … … 33 34 import zipfile 34 35 36 from logging import NullHandler 35 37 from webkitcorepy import log 36 38 from webkitcorepy.version import Version … … 216 218 shutil.rmtree(self.location, ignore_errors=True) 217 219 218 log.warning('Downloading {}...'.format(archive))220 AutoInstall.log('Downloading {}...'.format(archive)) 219 221 archive.download() 220 222 … … 231 233 continue 232 234 233 log.warning('Installing {}...'.format(archive))235 AutoInstall.log('Installing {}...'.format(archive)) 234 236 235 237 if self.slow_install: 236 log.warning('{} is known to be slow to install'.format(archive))238 AutoInstall.log('{} is known to be slow to install'.format(archive)) 237 239 238 240 with open(os.devnull, 'w') as devnull: … … 291 293 AutoInstall.userspace_should_own(manifest) 292 294 293 log.warning('Installed {}!'.format(archive))295 AutoInstall.log('Installed {}!'.format(archive)) 294 296 except Exception: 295 log.critical('Failed to install {}!'.format(archive))297 AutoInstall.log('Failed to install {}!'.format(archive), level=logging.CRITICAL) 296 298 raise 297 299 … … 492 494 yield tags.Tag(tag.interpreter, tag.abi, override) 493 495 496 @classmethod 497 def log(cls, message, level=logging.WARNING): 498 if not log.handlers or all([isinstance(handle, NullHandler) for handle in log.handlers]): 499 sys.stderr.write(message + '\n') 500 else: 501 log.log(level, message) 502 494 503 495 504 sys.meta_path.insert(0, AutoInstall)
Note: See TracChangeset
for help on using the changeset viewer.