Close the debug log file if open. Call this when the application exits to ensure clean shutdown.
()
| 40 | |
| 41 | |
| 42 | def close_debug_log() -> None: |
| 43 | """Close the debug log file if open. |
| 44 | |
| 45 | Call this when the application exits to ensure clean shutdown. |
| 46 | """ |
| 47 | global _debug_log_file |
| 48 | if _debug_log_file is not None: |
| 49 | try: |
| 50 | _debug_log_file.close() |
| 51 | except Exception: |
| 52 | pass |
| 53 | _debug_log_file = None |