Sha256: 13cf900165dceadad5cdb60c4cddb8f27b22098bfe6a6defb167f93c0d791f69

Contents?: true

Size: 458 Bytes

Versions: 2

Compression:

Stored size: 458 Bytes

Contents

require 'logger'
require 'singleton'

module Ara
   def self.logger
      return L.instance.logger
   end

   def self.logger=(l)
      L.instance.logger=l
   end

   class L #:nodoc:
      include Singleton

      def initialize
         @mutex = Mutex.new
         @logger = Logger.new STDERR
      end

      def logger
         @mutex.synchronize { @logger }
      end

      def logger=(l)
         @mutex.synchronize { @logger=l }
      end
   end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ara-0.0.2 lib/ara/logger.rb
ara-0.0.1 lib/ara/logger.rb