class Dk::Config::LogslyLogger

Constants

LOG_TYPE

Attributes

config[R]

Public Class Methods

new(config) click to toggle source
Calls superclass method
# File lib/dk/config.rb, line 192
def initialize(config)
  @config = config # set the reader first so it can be used when supering

  Logsly.stdout(@config.dk_logger_stdout_output_name) do |logger|
    level   logger.config.stdout_log_level
    pattern logger.config.log_pattern
  end
  outputs = [@config.dk_logger_stdout_output_name]

  if @config.log_file
    Logsly.file(@config.dk_logger_file_output_name) do |logger|
      path    File.expand_path(logger.config.log_file, ENV['PWD'])
      level   Dk::Config::FILE_LOG_LEVEL
      pattern logger.config.log_file_pattern
    end
    outputs << @config.dk_logger_file_output_name
  end

  super(LOG_TYPE, :outputs => outputs)
end