Class: Epuber::Logger::ConsoleLogger
- Inherits:
-
AbstractLogger
- Object
- AbstractLogger
- Epuber::Logger::ConsoleLogger
- Defined in:
- lib/epuber/utils/logger/console_logger.rb
Constant Summary
Constants inherited from AbstractLogger
Instance Attribute Summary
Attributes inherited from AbstractLogger
Instance Method Summary collapse
Methods inherited from AbstractLogger
#debug, #end_processing, #error, #error!, #error?, #info, #initialize, #print_processing_debug_info, #print_step_processing_time, #start_processing_file, #warning
Constructor Details
This class inherits a constructor from Epuber::Logger::AbstractLogger
Instance Method Details
#_log(level, message, location: nil, backtrace: nil, sticky: false) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/epuber/utils/logger/console_logger.rb', line 8 def _log(level, , location: nil, backtrace: nil, sticky: false) prev_line = # save sticky message @sticky_message = if sticky = (level, , location: location, backtrace: backtrace) # print the message if sticky $stdout.print() else $stdout.puts() # reprint previous sticky message when this message is not sticky if prev_line @sticky_message = prev_line $stdout.print(prev_line) end end end |