generated from nathanwoodburn/python-webserver-template
feat: Remove time from logs
All checks were successful
Build Docker / BuildImage (push) Successful in 57s
All checks were successful
Build Docker / BuildImage (push) Successful in 57s
This commit is contained in:
@@ -33,7 +33,7 @@ def log(message: str):
|
|||||||
f.write("")
|
f.write("")
|
||||||
|
|
||||||
with open(log_path, "a") as f:
|
with open(log_path, "a") as f:
|
||||||
f.write(f"{datetime.now().isoformat()} - {message}\n")
|
f.write(f"{message}\n")
|
||||||
print(f"{datetime.now().isoformat()} - {message}") # Also print to console for debugging
|
print(f"{datetime.now().isoformat()} - {message}") # Also print to console for debugging
|
||||||
|
|
||||||
def find(name, path):
|
def find(name, path):
|
||||||
@@ -112,9 +112,9 @@ def restart():
|
|||||||
# Start with a new process
|
# Start with a new process
|
||||||
output = os.system(f"spotifyd -d '{SPEAKER_NAME}' --onevent {hookPath}")
|
output = os.system(f"spotifyd -d '{SPEAKER_NAME}' --onevent {hookPath}")
|
||||||
if output != 0:
|
if output != 0:
|
||||||
log("Failed to restart spotifyd")
|
log("Failed to start spotifyd")
|
||||||
else:
|
else:
|
||||||
log("spotifyd restarted successfully")
|
log("Spotify started successfully")
|
||||||
|
|
||||||
return redirect('/')
|
return redirect('/')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user