flare / log.py
ciyidogan's picture
Update log.py
0b31526 verified
raw
history blame
352 Bytes
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