Class: Zold::VerboseThread

Inherits:
Object
  • Object
show all
Defined in:
lib/zold/verbose_thread.rb

Overview

Verbose thread

Instance Method Summary collapse

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

#runObject



34
35
36
37
38
39
# File 'lib/zold/verbose_thread.rb', line 34

def run
  yield
rescue StandardError => e
  @log.error("#{e.class.name}: #{e.message} #{e.backtrace.join("\n\t")}")
  raise e
end