Spaces:
Sleeping
Sleeping
fix: correct log file path to ensure writability on server
Browse files
logs.py
CHANGED
|
@@ -2,12 +2,9 @@ import os
|
|
| 2 |
from datetime import datetime
|
| 3 |
|
| 4 |
# Garante a compatibilidade do caminho do log entre os ambientes
|
|
|
|
| 5 |
if os.name == 'nt':
|
| 6 |
-
|
| 7 |
-
LOG_FILE = "recommender.log"
|
| 8 |
-
else:
|
| 9 |
-
# Para qualquer outro sistema (Linux, etc.), usa a pasta /tmp
|
| 10 |
-
LOG_FILE = "/tmp/recommender.log"
|
| 11 |
|
| 12 |
|
| 13 |
def save_log(user_id: int, history: dict, response: str):
|
|
|
|
| 2 |
from datetime import datetime
|
| 3 |
|
| 4 |
# Garante a compatibilidade do caminho do log entre os ambientes
|
| 5 |
+
LOG_FILE_PATH = "/tmp/recommender.log"
|
| 6 |
if os.name == 'nt':
|
| 7 |
+
LOG_FILE_PATH = "recommender.log"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
|
| 10 |
def save_log(user_id: int, history: dict, response: str):
|