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