Class: LoggerFacade::Manager

Inherits:
Object
  • Object
show all
Defined in:
lib/logger_facade/manager.rb

Class Method Summary collapse

Class Method Details

.clear_pluginsObject



15
16
17
# File 'lib/logger_facade/manager.rb', line 15

def self.clear_plugins
  @@plugins = []
end

.get_logger(name) ⇒ Object



19
20
21
# File 'lib/logger_facade/manager.rb', line 19

def self.get_logger(name)
  LoggerFacade::Log.new(name, registered_plugins)
end

.pluginsObject



11
12
13
# File 'lib/logger_facade/manager.rb', line 11

def self.plugins
  registered_plugins.map(&:name)
end

.use(plugin) ⇒ Object



5
6
7
8
9
# File 'lib/logger_facade/manager.rb', line 5

def self.use(plugin)
  fail 'Invalid plugin argument' unless plugin

  registered_plugins << plugin
end