Module: LogSyringe

Defined in:
lib/log_syringe.rb,
lib/log_syringe/dsl.rb,
lib/log_syringe/version.rb

Overview

Top level namespace

Defined Under Namespace

Classes: DSL

Constant Summary collapse

VERSION =

Current version for this gem

'0.1.0'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.loggerObject

The logger to be passed to log_method blocks


9
10
11
# File 'lib/log_syringe.rb', line 9

def logger
  @logger
end

Class Method Details

.define(klass, &block) ⇒ Object

Define logging for a class/module

Examples:

LogSyringe.define(MyClass) do
  log_method(:some_method) do |logger, instance, stats|
    logger.info(
      "some method called on #{instance} with #{stats[:args]}"
    )
  end
end

21
22
23
# File 'lib/log_syringe.rb', line 21

def define(klass, &block)
  DSL.new(klass, &block)
end