Sha256: c793f5f81696134a41de6969cd1e7ecb611061b7f4de3c37a9f0c4e7460c1348

Contents?: true

Size: 463 Bytes

Versions: 4

Compression:

Stored size: 463 Bytes

Contents

require 'logger'

module Telegraph
  module Logging
    def self.logger
      @logger ||= begin
        l = Logger.new($stdout)
        l.level = Logger.const_get((ENV['TELEGRAPH_LOG_LEVEL'] || 'info').upcase)
        l.formatter = proc do |sev, time, progmane, msg|
          "[#{time.strftime "%T"}] (pid #{Process.pid}) #{msg}\n"
        end
        l
      end
    end

    def debug
      Logging.logger.debug { "#{self.class}: #{yield}" }
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
deep_test_pre-2.0 lib/telegraph/logging.rb
jstorimer-deep-test-2.0.0 lib/telegraph/logging.rb
jstorimer-deep-test-0.2.0 lib/telegraph/logging.rb
jstorimer-deep-test-0.1.0 lib/telegraph/logging.rb