Class: Cardio::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/cardio/logger.rb,
lib/cardio/logger/request.rb,
lib/cardio/logger/performance.rb,
lib/cardio/logger/performance/entry.rb,
lib/cardio/logger/performance/big_brother.rb,
lib/cardio/logger/performance/category_log.rb,
lib/cardio/logger/performance/html_formatter.rb,
lib/cardio/logger/performance/text_formatter.rb,
lib/cardio/logger/performance/method_preparation.rb

Defined Under Namespace

Classes: Performance, Request

Class Method Summary collapse

Class Method Details

.with_logging(method, opts, &block) ⇒ Object



4
5
6
7
8
9
# File 'lib/cardio/logger.rb', line 4

def self.with_logging method, opts, &block
  return block.call unless Performance.enabled_method? method
  Performance.with_timer(method, opts) do
    block.call
  end
end