Class: Kraaken::Logger
- Inherits:
-
ActiveSupport::Logger
- Object
- ActiveSupport::Logger
- Kraaken::Logger
- Defined in:
- lib/kraaken/logger.rb
Defined Under Namespace
Classes: Color, Formatter, LogDevice
Instance Method Summary collapse
- #increment_progress(by: 1) ⇒ Object
-
#initialize ⇒ Logger
constructor
A new instance of Logger.
- #with_progress(total:, title: nil, &block) ⇒ Object
Constructor Details
Instance Method Details
#increment_progress(by: 1) ⇒ Object
25 26 27 |
# File 'lib/kraaken/logger.rb', line 25 def increment_progress(by: 1) @progress_bar&.progress += by end |
#with_progress(total:, title: nil, &block) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/kraaken/logger.rb', line 12 def with_progress(total:, title: nil, &block) @progress_bar = ProgressBar.create( total:, title:, format: "%t |#{color("%B", color: :blue)}|" ) block.call @progress_bar.finish @progress_bar = nil end |