This commit enhances the logging system with better thread safety and proper test configuration:
- Replace RefCell with RwLock in SimpleLogger for thread-safe logging
- Add proper feature flag configuration for test-sync
- Organize logging modules with clear separation between prod and test
- Update test files with proper feature flag annotations
- Fix module structure in lib.rs to avoid duplicate definitions
Technical changes:
- Use RwLock for thread-safe log writer access
- Add #![cfg(feature = "test-sync")] to all test files
- Configure .cargo/config.toml for test-sync feature
- Update Cargo.toml with proper test configurations
- Clean up logging module exports
This change ensures thread-safe logging in production while maintaining
separate test-specific synchronization primitives, improving overall
reliability and maintainability.
- Use lib.rs for library mode and used with log tests
- Improve enum for tasks on files with file_type.rs
- Fix main and directory_processing
- Add Errors
- Adjust loggint.rs with OneLock and Atomic to control with parallel tests
- Add test.rs for unitary tests
BREAKING CHANGE: Logging output now goes to either file or console, not both
Logging changes:
- Rename MultiWriter to LogWriter for clarity
- Change logging to write to either file or console exclusively
- Improve log initialization message format
- Add better documentation for logging behavior
Test organization:
- Move tests from directory_processor.rs to separate test modules
- Follow modern Rust convention using tests.rs instead of mod.rs
- Create proper test directory structure under src/tests/
- Make necessary struct fields pub(crate) for testing
This commit improves code organization and makes logging behavior more
conventional by directing output to a single destination.