flare / utils.py
ciyidogan's picture
Update utils.py
fb3f277 verified
raw
history blame
391 Bytes
import json
import sys
from datetime import datetime
CONFIG_FILE = "service_config.json"
def log(message: str):
timestamp = datetime.now().strftime("%H:%M:%S.%f")[:-3]
print(f"[{timestamp}] {message}")
sys.stdout.flush()
def save_service_config(config):
with open(CONFIG_FILE, "w") as f:
json.dump(config.data, f, indent=2)
log("βœ… Config saved to disk")