Class: Log

Inherits:
Object
  • Object
show all
Defined in:
lib/arid/log.rb

Class Method Summary collapse

Class Method Details

.log_call(print_func, errors = true, &block) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/arid/log.rb', line 3

def log_call(print_func, errors = true, &block)
  puts print_func
  begin
    print_func.call('Call %s' % "<method_signature>" )
    result = yield
    print_func.call('-> Result %s'% "<pretty_result>" )
  rescue => e
    print_func.call("-> Error $s"% "<pretty_error>")	    
    raise
  end    
end