Class: Unibanner::Logger

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

Constant Summary collapse

@@loggers =
{}
@@instance =
Logging::Repository.instance

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Logger

create a new Unibanner::Logger instance

Parameters:

  • name (Object)

    an object returning a valid name for the logger



57
58
59
# File 'lib/unibanner/logger.rb', line 57

def initialize(name)
  @@loggers[name] = Logging.logger[name]
end

Class Method Details

.[](key) ⇒ Unibanner::Logger

grab a logger from the list for use

Parameters:

  • key (Object)

    name of logger

Returns:



74
75
76
# File 'lib/unibanner/logger.rb', line 74

def self.[](key)
  @@loggers[key]
end

Instance Method Details

#loggersArray

return the loggers list

Returns:

  • (Array)

    loggers list



67
68
69
# File 'lib/unibanner/logger.rb', line 67

def loggers
  @@loggers
end

#updateObject

update the loggers



62
63
64
# File 'lib/unibanner/logger.rb', line 62

def update
  @@instance = Logging::Repository.instance
end