Class: ModSpox::Logger
- Inherits:
-
Object
- Object
- ModSpox::Logger
- Defined in:
- lib/mod_spox/Logger.rb
Class Method Summary collapse
- .error(s) ⇒ Object
- .fatal(s) ⇒ Object
- .info(s) ⇒ Object
- .initialize(logger, level) ⇒ Object
- .log? ⇒ Boolean
- .raw ⇒ Object
- .warn(s) ⇒ Object
Class Method Details
.error(s) ⇒ Object
24 25 26 |
# File 'lib/mod_spox/Logger.rb', line 24 def Logger.error(s) @@log.error(s) if Logger.log? end |
.fatal(s) ⇒ Object
20 21 22 |
# File 'lib/mod_spox/Logger.rb', line 20 def Logger.fatal(s) @@log.fatal(s) if Logger.log? end |
.info(s) ⇒ Object
16 17 18 |
# File 'lib/mod_spox/Logger.rb', line 16 def Logger.info(s) @@log.info(s) if Logger.log? end |
.initialize(logger, level) ⇒ Object
6 7 8 9 10 |
# File 'lib/mod_spox/Logger.rb', line 6 def Logger.initialize(logger, level) l = {:info => ::Logger::INFO, :error => ::Logger::ERROR, :warn => ::Logger::WARN, :fatal => ::Logger::FATAL} @@log = logger.is_a?(::Logger) ? logger : nil @@log.level = l[level] end |
.log? ⇒ Boolean
28 29 30 |
# File 'lib/mod_spox/Logger.rb', line 28 def Logger.log? Logger.class_variable_defined?(:@@log) end |