Module: Extlib

Defined in:
lib/gems/extlib-0.9.9/lib/extlib/logger.rb,
lib/gems/extlib-0.9.9/lib/extlib.rb,
lib/gems/extlib-0.9.9/lib/extlib/hook.rb,
lib/gems/extlib-0.9.9/lib/extlib/pooling.rb,
lib/gems/extlib-0.9.9/lib/extlib/version.rb,
lib/gems/extlib-0.9.9/lib/extlib/assertions.rb,
lib/gems/extlib-0.9.9/lib/extlib/inflection.rb,
lib/gems/extlib-0.9.9/lib/extlib/simple_set.rb

Overview

Public Merb Logger API

To replace an existing logger with a new one:

Merb::Logger.set_log(log{String, IO},level{Symbol, String})

Available logging levels are

Merb::Logger::{ Fatal, Error, Warn, Info, Debug }

Logging via:

Merb.logger.fatal(message<String>,&block)
Merb.logger.error(message<String>,&block)
Merb.logger.warn(message<String>,&block)
Merb.logger.info(message<String>,&block)
Merb.logger.debug(message<String>,&block)

Logging with autoflush:

Merb.logger.fatal!(message<String>,&block)
Merb.logger.error!(message<String>,&block)
Merb.logger.warn!(message<String>,&block)
Merb.logger.info!(message<String>,&block)
Merb.logger.debug!(message<String>,&block)

Flush the buffer to

Merb.logger.flush

Remove the current log object

Merb.logger.close

Private Merb Logger API

To initialize the logger you create a new object, proxies to set_log.

Merb::Logger.new(log{String, IO},level{Symbol, String})

Defined Under Namespace

Modules: Assertions, Hook, Inflection, Pooling Classes: Logger, SimpleSet

Constant Summary collapse

VERSION =
'0.9.9'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.loggerObject

Returns the value of attribute logger.



37
38
39
# File 'lib/gems/extlib-0.9.9/lib/extlib/logger.rb', line 37

def logger
  @logger
end

Class Method Details

.exitingObject



52
53
54
# File 'lib/gems/extlib-0.9.9/lib/extlib.rb', line 52

def self.exiting
  @exiting
end

.exiting=(bool) ⇒ Object



43
44
45
46
47
48
49
50
# File 'lib/gems/extlib-0.9.9/lib/extlib.rb', line 43

def self.exiting= bool
  if bool && Extlib.const_defined?("Pooling")
    if Extlib::Pooling.scavenger?
      Extlib::Pooling.scavenger.wakeup
    end
  end
  @exiting = true
end