Class: Zold::VerboseThread
- Inherits:
-
Object
- Object
- Zold::VerboseThread
- Defined in:
- lib/zold/verbose_thread.rb
Overview
Verbose thread
Instance Method Summary collapse
-
#initialize(log = Log::Quiet.new) ⇒ VerboseThread
constructor
A new instance of VerboseThread.
- #run(safe = false) ⇒ Object
Constructor Details
#initialize(log = Log::Quiet.new) ⇒ VerboseThread
Returns a new instance of VerboseThread.
30 31 32 |
# File 'lib/zold/verbose_thread.rb', line 30 def initialize(log = Log::Quiet.new) @log = log end |
Instance Method Details
#run(safe = false) ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/zold/verbose_thread.rb', line 34 def run(safe = false) yield rescue StandardError => e @log.error("#{e.class.name}: #{e.}") @log.debug(e.backtrace.join("\n\t")) raise e unless safe end |