To replace an existing logger with a new one:
Extlib::Logger.set_log(log{String, IO},level{Symbol, String})
Available logging levels are
Extlib::Logger::{ Fatal, Error, Warn, Info, Debug }
Logging via:
Extlib.logger.fatal(message<String>,&block) Extlib.logger.error(message<String>,&block) Extlib.logger.warn(message<String>,&block) Extlib.logger.info(message<String>,&block) Extlib.logger.debug(message<String>,&block)
Logging with autoflush:
Extlib.logger.fatal!(message<String>,&block) Extlib.logger.error!(message<String>,&block) Extlib.logger.warn!(message<String>,&block) Extlib.logger.info!(message<String>,&block) Extlib.logger.debug!(message<String>,&block)
Flush the buffer to
Extlib.logger.flush
Remove the current log object
Extlib.logger.close
To initialize the logger you create a new object, proxies to set_log.
Extlib::Logger.new(log{String, IO},level{Symbol, String})
Inflector | = | ActiveSupport::Inflector |
Inflector | = | Extlib::Inflection |
VERSION | = | '1.0.0' |
logger | [RW] |
Perform necessary steps to finalize DataMapper for the current repository
This method should be called after loading all models and plugins.
It ensures foreign key properties and anonymous join models are created. These are otherwise lazily declared, which can lead to unexpected errors. It also performs basic validity checking of the DataMapper models.
@return [DataMapper] The DataMapper module
@api public
Block Syntax
Pushes the named repository onto the context-stack, yields a new session, and pops the context-stack.
Non-Block Syntax
Returns the current session, or if there is none, a new Session.
@param [Symbol] args the name of a repository to act within or return, :default is default
@yield [Proc] (optional) block to execute within the context of the named repository
@api public
Setups up a connection to a data-store
@param [Symbol] name
a name for the context, defaults to :default
@param [Hash(Symbol => String), Addressable::URI, String] uri_or_options
connection information
@return [DataMapper::Adapters::AbstractAdapter]
the resulting setup adapter
@raise [ArgumentError] "name must be a Symbol, but was…"
indicates that an invalid argument was passed for name[Symbol]
@raise [ArgumentError] "uri_or_options must be a Hash, URI or String, but was…"
indicates that connection information could not be gleaned from the given uri_or_options[Hash, Addressable::URI, String]
@api public