Spaces:
Runtime error
Runtime error
| import os | |
| import json | |
| from datetime import datetime | |
| def log_request(event, **kwargs): | |
| """Log request events""" | |
| timestamp = datetime.now().isoformat() | |
| log_entry = { | |
| "timestamp": timestamp, | |
| "event": event, | |
| **kwargs | |
| } | |
| # Print to console (will appear in Hugging Face logs) | |
| print(json.dumps(log_entry)) | |
| # In a production environment, you might also send to a logging service | |