Class: Jekyll::L10n::ExtractionLogger
- Inherits:
-
Object
- Object
- Jekyll::L10n::ExtractionLogger
- Defined in:
- lib/jekyll-l10n/extraction/logger.rb
Overview
Logs extraction process errors and summary statistics.
ExtractionLogger provides centralized logging for the extraction pipeline, recording errors during extraction and final summary statistics including file count, string count, PO file creation count, and elapsed time.
Key responsibilities:
-
Log extraction errors with file context
-
Log extraction summary statistics
-
Format statistics output for user visibility
Class Method Summary collapse
-
.log_error(file_path, error) ⇒ void
Log an extraction error.
-
.log_summary(stats, elapsed) ⇒ void
Log extraction completion summary.
Class Method Details
.log_error(file_path, error) ⇒ void
This method returns an undefined value.
Log an extraction error.
24 25 26 |
# File 'lib/jekyll-l10n/extraction/logger.rb', line 24 def self.log_error(file_path, error) Jekyll.logger.error 'Localization', "Error extracting from #{file_path}: #{error.}" end |
.log_summary(stats, elapsed) ⇒ void
This method returns an undefined value.
Log extraction completion summary.
Logs final statistics about the extraction process including total files processed, strings extracted, PO files created/updated, and elapsed time.
39 40 41 42 43 44 45 |
# File 'lib/jekyll-l10n/extraction/logger.rb', line 39 def self.log_summary(stats, elapsed) Jekyll.logger.info 'Localization', 'Extraction complete:' Jekyll.logger.info 'Localization', " Files processed: #{stats[:files_processed]}" Jekyll.logger.info 'Localization', " Strings extracted: #{stats[:strings_extracted]}" Jekyll.logger.info 'Localization', " PO files created/updated: #{stats[:po_files_created]}" Jekyll.logger.info 'Localization', " Time: #{elapsed.round(2)}s" end |