Module: DataObjects

Defined in:
lib/mack-data_mapper/dm_patches/uri.rb,
lib/gems/data_objects-0.9.10.1/lib/data_objects.rb,
lib/gems/data_objects-0.9.10.1/lib/data_objects/uri.rb,
lib/gems/data_objects-0.9.10.1/lib/data_objects/field.rb,
lib/gems/data_objects-0.9.10.1/lib/data_objects/logger.rb,
lib/gems/data_objects-0.9.10.1/lib/data_objects/reader.rb,
lib/gems/data_objects-0.9.10.1/lib/data_objects/result.rb,
lib/gems/data_objects-0.9.10.1/lib/data_objects/command.rb,
lib/gems/data_objects-0.9.10.1/lib/data_objects/quoting.rb,
lib/gems/data_objects-0.9.10.1/lib/data_objects/version.rb,
lib/gems/data_objects-0.9.10.1/lib/data_objects/connection.rb,
lib/gems/data_objects-0.9.10.1/lib/data_objects/transaction.rb

Overview

Public DataObjects Logger API

Logger taken from Merb :)

To replace an existing logger with a new one:

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

Available logging levels are

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

Logging via:

DataObjects.logger.fatal(message<String>)
DataObjects.logger.error(message<String>)
DataObjects.logger.warn(message<String>)
DataObjects.logger.info(message<String>)
DataObjects.logger.debug(message<String>)

Flush the buffer to

DataObjects.logger.flush

Remove the current log object

DataObjects.logger.close

Private DataObjects Logger API

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

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

Logger will not create the file until something is actually logged This avoids file creation on DataObjects init when it creates the default logger.

Defined Under Namespace

Modules: Quoting Classes: Command, Connection, Field, LengthMismatchError, Logger, Reader, Result, Transaction, URI

Constant Summary collapse

VERSION =
"0.9.10.1"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.loggerObject

Returns the value of attribute logger.



36
37
38
# File 'lib/gems/data_objects-0.9.10.1/lib/data_objects/logger.rb', line 36

def logger
  @logger
end

Class Method Details

.find_const(name) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/gems/data_objects-0.9.10.1/lib/data_objects.rb', line 25

def self.find_const(name)
  klass = Object
  name.to_s.split('::').each do |part|
    klass = klass.const_get(part)
  end
  klass
end

.rootObject



21
22
23
# File 'lib/gems/data_objects-0.9.10.1/lib/data_objects.rb', line 21

def self.root
  @root ||= Pathname(__FILE__).dirname.parent.expand_path
end