Sha256: 6525ba57c7d6e7c143a1a52c14361c833af2c45b347067d24a0cc9bf3ab57d58

Contents?: true

Size: 214 Bytes

Versions: 7

Compression:

Stored size: 214 Bytes

Contents

module Msgr

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

    def log_name
      "[#{Thread.current.object_id}] #{self.to_s}"
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
msgr-0.4.1 lib/msgr/logging.rb
msgr-0.4.0 lib/msgr/logging.rb
msgr-0.3.0 lib/msgr/logging.rb
msgr-0.2.1 lib/msgr/logging.rb
msgr-0.2.0 lib/msgr/logging.rb
msgr-0.1.1 lib/msgr/logging.rb
msgr-0.1.0 lib/msgr/logging.rb