Module: Swineherd

Defined in:
lib/swineherd-fs.rb,
lib/swineherd-fs/s3filesystem.rb,
lib/swineherd-fs/localfilesystem.rb,
lib/swineherd-fs/hadoopfilesystem.rb

Defined Under Namespace

Modules: FileSystem Classes: HadoopFileSystem, LocalFileSystem, S3FileSystem

Class Method Summary collapse

Class Method Details

.configObject



18
19
20
21
22
23
24
# File 'lib/swineherd-fs.rb', line 18

def self.config
  return @config if @config
  config = Configliere::Param.new
  config.read SYSTEM_CONFIG_PATH if File.exists? SYSTEM_CONFIG_PATH
  config.read USER_CONFIG_PATH  if File.exists? USER_CONFIG_PATH
  @config ||= config
end

.loggerObject



26
27
28
29
30
31
32
33
# File 'lib/swineherd-fs.rb', line 26

def self.logger
  return @log if @log
  @log ||= Logger.new(config[:log_file] || STDOUT)
  @log.formatter = proc { |severity, datetime, progname, msg|
    "[#{severity.upcase}] #{msg}\n"
  }
  @log
end

.logger=(logger) ⇒ Object



35
36
37
# File 'lib/swineherd-fs.rb', line 35

def self.logger= logger
  @log = logger
end