Spaces:
Running
Running
from datetime import datetime | |
def log(message): | |
timestamp = datetime.now().strftime("%H:%M:%S") | |
line = f"[{timestamp}] {message}" | |
print(line, flush=True) | |
try: | |
with open("/tmp/logs.txt", "a", encoding="utf-8") as f: | |
f.write(line + "\n") | |
except Exception: | |
pass # dosya erişim hataları sessizce geçilir |