Sha256: e52385b98cde5017b54a831520b17758d4a8d0fb0e130989dc090a39ab98d20d

Contents?: true

Size: 693 Bytes

Versions: 7

Compression:

Stored size: 693 Bytes

Contents

require 'forwardable'

module SearchKit
  # The SearchKit logger, handled in its own class mainly for the purpose
  # of allowing the daemonized process to quickly and cleanly reinitialize its
  # connection to logfiles even after its process has been decoupled.
  #
  class Logger
    extend Forwardable

    attr_reader :logger

    def_delegators :logger, :info, :warn

    def initialize
      environment = SearchKit.config.app_env

      loginfo = [
        SearchKit.config.log_dir,
        "search-kit-#{environment}.log"
      ]

      logpath = File.join(*loginfo)
      default = ::Logger.new(logpath, "daily")

      @logger = SearchKit.config.logger || default
    end
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
search-kit-0.0.10 lib/search_kit/logger.rb
search-kit-0.0.9 lib/search_kit/logger.rb
search-kit-0.0.8 lib/search_kit/logger.rb
search-kit-0.0.7 lib/search_kit/logger.rb
search-kit-0.0.6 lib/search_kit/logger.rb
search-kit-0.0.5 lib/search_kit/logger.rb
search-kit-0.0.4 lib/search_kit/logger.rb