Class: Nasty::Log

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

Class Method Summary collapse

Class Method Details

.bind_to(log_factory) ⇒ Object



6
7
8
# File 'lib/nasty/log.rb', line 6

def bind_to(log_factory)
  @@log_factory = log_factory
end

.for(target) ⇒ Object



10
11
12
13
14
15
# File 'lib/nasty/log.rb', line 10

def for(target)
  unless class_variable_defined? :@@log_factory
    @@log_factory = ConsoleLogFactory.new
  end
  @@log_factory.create_for(target)
end

.unbindObject



17
18
19
# File 'lib/nasty/log.rb', line 17

def unbind
  remove_class_variable(:@@log_factory)
end