Sha256: afaefeba017fc0600db095fe4bb0bf656982fa0b894a6dd96ca1eeec74d11983
Contents?: true
Size: 645 Bytes
Versions: 33
Compression:
Stored size: 645 Bytes
Contents
require 'logger' require 'pathname' module PactBroker module Logging # Need to make this configurable based on the calling app! LOG_DIR = Pathname.new(File.join(File.dirname(__FILE__), '..', '..', 'log')).cleanpath LOG_FILE_NAME = "#{ENV['RACK_ENV'] || 'development'}.log" def self.included(base) base.extend(self) end def logger= logger @@logger = logger end def logger @@logger ||= begin FileUtils.mkdir_p(LOG_DIR) logger = Logger.new(File.join(LOG_DIR, LOG_FILE_NAME)) logger.level = Logger::DEBUG logger end end end include Logging end
Version data entries
33 entries across 33 versions & 1 rubygems