Module: Hydra::Trace::InstanceMethods

Defined in:
lib/hydra/trace.rb

Instance Method Summary collapse

Instance Method Details

#trace(str) ⇒ Object

Trace some output with the class’s prefix and a newline. Checks to ensure we’re running verbosely.



18
19
20
21
22
23
24
25
# File 'lib/hydra/trace.rb', line 18

def trace(str)
  $stdout.write "#{Time.now.to_f} #{self.class._traceable_prefix}| #{str}\n" if @verbose

  prefix = self.class._traceable_prefix.upcase
  unless (prefix == 'MASTER' || prefix == 'SYNC')
    $stdout.write "\n"
  end
end