Module: RPCMapper

Defined in:
lib/rpc_mapper.rb,
lib/rpc_mapper/errors.rb,
lib/rpc_mapper/logger.rb,
lib/rpc_mapper/version.rb

Defined Under Namespace

Modules: Adapters, Association, AssociationPreload, Associations, Cacheable, FinderMethods, Logger, Persistence, QueryMethods, Scopes, Serialization, Version Classes: AssociationError, AssociationNotFound, AssociationPreloadNotSupported, Base, PolymorphicAssociationTypeError, RPCMapperError, RecordNotFound, RecordNotSaved

Constant Summary collapse

@@log_file =
nil

Class Method Summary collapse

Class Method Details

.default_loggerObject



36
37
38
39
40
41
42
43
# File 'lib/rpc_mapper.rb', line 36

def self.default_logger
  if defined?(Rails)
    Rails.logger
  else
    require 'logger' unless defined?(::Logger)
    ::Logger.new(@@log_file)
  end
end

.log_file=(file) ⇒ Object



32
33
34
# File 'lib/rpc_mapper.rb', line 32

def self.log_file=(file)
  @@log_file = file
end

.loggerObject



24
25
26
# File 'lib/rpc_mapper.rb', line 24

def self.logger
  @@logger ||= default_logger
end

.logger=(logger) ⇒ Object



28
29
30
# File 'lib/rpc_mapper.rb', line 28

def self.logger=(logger)
  @@logger = logger
end