Sha256: d94c9c75a41cb4b14f2f848a252bc03b500729cd7334c02c9bde5d52bd616478

Contents?: true

Size: 804 Bytes

Versions: 19

Compression:

Stored size: 804 Bytes

Contents

#--
# Configure logging
#++
include Log4r

log_dir_loc = File.join(MACK_ROOT, "log")
FileUtils.mkdir_p(log_dir_loc)

unless Object.const_defined?("MACK_DEFAULT_LOGGER")
  log = Log4r::Logger.new('')
  log.level =  Module.instance_eval("Log4r::#{app_config.log.level.to_s.upcase}")
  # console:
  if app_config.log.console
    console_format = PatternFormatter.new(:pattern => app_config.log.console_format)
    log.add(Log4r::StdoutOutputter.new('console', :formatter => console_format))
  end
  # file:
  if app_config.log.file
    file_format = PatternFormatter.new(:pattern => app_config.log.file_format)
    log.add(FileOutputter.new('fileOutputter', :filename => File.join(log_dir_loc, "#{MACK_ENV}.log"), :trunc => false, :formatter => file_format))
  end
  
  Object::MACK_DEFAULT_LOGGER = log
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
mack-0.0.3 initialize/configure_logging.rb
mack-0.0.6.1 initialization/initializers/logging.rb
mack-0.0.6.2 initialization/initializers/logging.rb
mack-0.0.4 initialize/configure_logging.rb
mack-0.0.5 initialization/initializers/logging.rb
mack-0.1.0 lib/initialization/initializers/logging.rb
mack-0.2.0.1 lib/initialization/initializers/logging.rb
mack-0.0.6 initialization/initializers/logging.rb
mack-0.0.7.0 lib/initialization/initializers/logging.rb
mack-0.2.0 lib/initialization/initializers/logging.rb
mack-0.3.0 lib/initialization/initializers/logging.rb
mack-0.4.0.1 lib/initialization/initializers/logging.rb
mack-0.4.0 lib/initialization/initializers/logging.rb
mack-0.4.1 lib/initialization/initializers/logging.rb
mack-0.4.2.1 lib/initialization/initializers/logging.rb
mack-0.4.7 lib/initialization/initializers/logging.rb
mack-0.4.5 lib/initialization/initializers/logging.rb
mack-0.4.6 lib/initialization/initializers/logging.rb
mack-0.4.2 lib/initialization/initializers/logging.rb