mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-03 17:39:42 +02:00
Enhance console logging: add option to print logs regardless of debug state
This commit is contained in:
@@ -45,7 +45,7 @@ def download_update(latest_version):
|
|||||||
new_filename = f"SoftwareManager-dev-{latest_version.replace('-dev', '')}-windows.exe"
|
new_filename = f"SoftwareManager-dev-{latest_version.replace('-dev', '')}-windows.exe"
|
||||||
url = f"https://github.com/KeksPirates/SoftwareManager/releases/latest/download/SoftwareManager-dev-{latest_version.replace('-dev', '')}-windows.exe"
|
url = f"https://github.com/KeksPirates/SoftwareManager/releases/latest/download/SoftwareManager-dev-{latest_version.replace('-dev', '')}-windows.exe"
|
||||||
|
|
||||||
consoleLog("Downloading update...")
|
consoleLog("Downloading update...", True)
|
||||||
response = r.get(url, allow_redirects=True)
|
response = r.get(url, allow_redirects=True)
|
||||||
with open(new_filename, "wb") as f:
|
with open(new_filename, "wb") as f:
|
||||||
f.write(response.content)
|
f.write(response.content)
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ def set_main_window(window):
|
|||||||
global _main_window
|
global _main_window
|
||||||
_main_window = window
|
_main_window = window
|
||||||
|
|
||||||
def consoleLog(text):
|
def consoleLog(text, printAnyways = False):
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
current_time = now.strftime("%H:%M:%S")
|
current_time = now.strftime("%H:%M:%S")
|
||||||
|
|
||||||
@@ -175,5 +175,5 @@ def consoleLog(text):
|
|||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if state.debug:
|
if state.debug or printAnyways:
|
||||||
print(f"[{current_time}] {text}")
|
print(f"[{current_time}] {text}")
|
||||||
Reference in New Issue
Block a user