Spaces:
Paused
Paused
Update utils.py
Browse files
utils.py
CHANGED
|
@@ -4,11 +4,11 @@ from datetime import datetime
|
|
| 4 |
|
| 5 |
CONFIG_FILE = "service_config.json"
|
| 6 |
|
| 7 |
-
def log(message):
|
| 8 |
-
timestamp = datetime.now().strftime("%H:%M:%S")
|
| 9 |
print(f"[{timestamp}] {message}")
|
| 10 |
sys.stdout.flush()
|
| 11 |
-
|
| 12 |
def save_service_config(config):
|
| 13 |
with open(CONFIG_FILE, "w") as f:
|
| 14 |
json.dump(config.data, f, indent=2)
|
|
|
|
| 4 |
|
| 5 |
CONFIG_FILE = "service_config.json"
|
| 6 |
|
| 7 |
+
def log(message: str):
|
| 8 |
+
timestamp = datetime.now().strftime("%H:%M:%S.%f")[:-3]
|
| 9 |
print(f"[{timestamp}] {message}")
|
| 10 |
sys.stdout.flush()
|
| 11 |
+
|
| 12 |
def save_service_config(config):
|
| 13 |
with open(CONFIG_FILE, "w") as f:
|
| 14 |
json.dump(config.data, f, indent=2)
|