Class: Spyt::Loggable::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/spyt/loggable/logger.rb

Overview

Logger Class: Internal class used by Loggable module to provide logging methods.

Instance Method Summary collapse

Constructor Details

#initialize(source) ⇒ Logger

Construct: Builds a Logger to represent a given source.

Parameters:

  • source (String)

    Name of this logger’s source



24
25
26
# File 'lib/spyt/loggable/logger.rb', line 24

def initialize source
	@source = source
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object

Generic Log Handler: Proxy to Log::method_missing



30
31
32
33
# File 'lib/spyt/loggable/logger.rb', line 30

def method_missing name, *args
	super unless LEVELS.include? name
	Spyt.send name, @source, *args
end