mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-19 22:00:00 +10:00
Reformat logging system
This commit is contained in:
@@ -28,10 +28,10 @@ class RoutePayloadDiskImage:
|
||||
"""
|
||||
|
||||
if self.constants.wxpython_variant is True and not self.constants.launcher_script:
|
||||
logging.info("- Running in Binary GUI mode, switching to tmp directory")
|
||||
logging.info("Running in Binary GUI mode, switching to tmp directory")
|
||||
self.temp_dir = tempfile.TemporaryDirectory()
|
||||
logging.info(f"- New payloads location: {self.temp_dir.name}")
|
||||
logging.info("- Creating payloads directory")
|
||||
logging.info(f"New payloads location: {self.temp_dir.name}")
|
||||
logging.info("Creating payloads directory")
|
||||
Path(self.temp_dir.name / Path("payloads")).mkdir(parents=True, exist_ok=True)
|
||||
self._unmount_active_dmgs(unmount_all_active=False)
|
||||
output = subprocess.run(
|
||||
@@ -45,12 +45,12 @@ class RoutePayloadDiskImage:
|
||||
stdout=subprocess.PIPE, stderr=subprocess.STDOUT
|
||||
)
|
||||
if output.returncode == 0:
|
||||
logging.info("- Mounted payloads.dmg")
|
||||
logging.info("Mounted payloads.dmg")
|
||||
self.constants.current_path = Path(self.temp_dir.name)
|
||||
self.constants.payload_path = Path(self.temp_dir.name) / Path("payloads")
|
||||
atexit.register(self._unmount_active_dmgs, unmount_all_active=False)
|
||||
else:
|
||||
logging.info("- Failed to mount payloads.dmg")
|
||||
logging.info("Failed to mount payloads.dmg")
|
||||
logging.info(f"Output: {output.stdout.decode()}")
|
||||
logging.info(f"Return Code: {output.returncode}")
|
||||
|
||||
@@ -78,13 +78,13 @@ class RoutePayloadDiskImage:
|
||||
# Check that only our personal payloads.dmg is unmounted
|
||||
if "shadow-path" in image:
|
||||
if self.temp_dir.name in image["shadow-path"]:
|
||||
logging.info(f"- Unmounting personal {variant}")
|
||||
logging.info(f"Unmounting personal {variant}")
|
||||
subprocess.run(
|
||||
["hdiutil", "detach", image["system-entities"][0]["dev-entry"], "-force"],
|
||||
stdout=subprocess.PIPE, stderr=subprocess.STDOUT
|
||||
)
|
||||
else:
|
||||
logging.info(f"- Unmounting {variant} at: {image['system-entities'][0]['dev-entry']}")
|
||||
logging.info(f"Unmounting {variant} at: {image['system-entities'][0]['dev-entry']}")
|
||||
subprocess.run(
|
||||
["hdiutil", "detach", image["system-entities"][0]["dev-entry"], "-force"],
|
||||
stdout=subprocess.PIPE, stderr=subprocess.STDOUT
|
||||
|
||||
Reference in New Issue
Block a user