Sha256: 87780380665bde2aeed2401dfbb71fc3ca28c8089a635e3e44f9c13db8fba3ae

Contents?: true

Size: 242 Bytes

Versions: 91

Compression:

Stored size: 242 Bytes

Contents

# frozen_string_literal: true

module Msgr
  module Logging
    def log(level)
      Msgr.logger.send(level) { "#{log_name} #{yield}" } if Msgr.logger
    end

    def log_name
      "[#{Thread.current.object_id.to_s(16)}]"
    end
  end
end

Version data entries

91 entries across 91 versions & 1 rubygems

Version Path
msgr-1.2.0 lib/msgr/logging.rb
msgr-1.1.0.1.b306 lib/msgr/logging.rb
msgr-1.1.0.1.b305 lib/msgr/logging.rb
msgr-1.1.0.1.b302 lib/msgr/logging.rb
msgr-1.1.0.1.b301 lib/msgr/logging.rb
msgr-1.1.0.1.b300 lib/msgr/logging.rb
msgr-1.1.0.1.b297 lib/msgr/logging.rb
msgr-1.1.0.1.b296 lib/msgr/logging.rb
msgr-1.1.0.1.b295 lib/msgr/logging.rb
msgr-1.1.0.1.b292 lib/msgr/logging.rb
msgr-1.1.0.1.b291 lib/msgr/logging.rb
msgr-1.1.0.1.b288 lib/msgr/logging.rb
msgr-1.1.0.1.b285 lib/msgr/logging.rb
msgr-1.1.0.1.b263 lib/msgr/logging.rb
msgr-1.1.0.1.b249 lib/msgr/logging.rb
msgr-1.1.0.1.b248 lib/msgr/logging.rb
msgr-1.1.0.1.b244 lib/msgr/logging.rb
msgr-1.1.0.1.b241 lib/msgr/logging.rb
msgr-1.1.0.1.b240 lib/msgr/logging.rb
msgr-1.1.0.1.b239 lib/msgr/logging.rb