Add logging infrastructure across the codebase with a consistent logger named "thon" and replace print statements with appropriate log levels (debug, info, warning, error). Improve error handling in the session processing pipeline by:
- Adding proper error message tracking in Thon.__aiter__
- Using shutil.move instead of os.rename for better cross-platform compatibility
- Enhancing the move utility function with better error handling and retry logic
- Adding debug logging in Converter for session conversion tracking
- Centralizing logging configuration in the main module
This change improves debugging capabilities and provides better visibility into the application's operation while maintaining the same functionality.
Add retry logic to the `move` function to handle cases where files are locked or in use. Implement comprehensive error handling and logging to provide detailed feedback about file movement operations. Update the `Thon` class to include more informative logging messages for banned account handling and client disconnection. Improve the `ProcessThon` class with proper resource cleanup during disconnection.
Remove redundant client deletion in the `ProcessThon` class to prevent potential issues with the client object being deleted twice. This change ensures that the client is only deleted once when the process is closed, maintaining consistency and avoiding potential errors.
Remove the client reference from the ProcessThon class after disconnection to prevent potential memory leaks and ensure proper cleanup of resources. This change ensures that the client object is dereferenced and garbage collected after the disconnection process is completed.
Add comprehensive documentation for the Thon project, including project overview, architecture, usage examples, and development conventions. Update the README.md file to provide clear installation instructions, usage examples, and project structure. Remove the unused CLI entry point from pyproject.toml.