File: logger.rb [dm-core-1.2.1 Documentation]

Last Modified
  2015-10-13 02:57:25 +0000
Requires

## Description

#### Public DataMapper Logger API

To replace an existing logger with a new one:

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

Available logging levels are

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

Logging via:

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

Logging with autoflush:

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

Flush the buffer to

    DataMapper.logger.flush

Remove the current log object

    DataMapper.logger.close

#### Private DataMapper Logger API

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

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