Sha256: 14ddf635bdd5387f90147cc5b1c87cd5161e92aaecbc89bc746ddda31f21066f

Contents?: true

Size: 984 Bytes

Versions: 20

Compression:

Stored size: 984 Bytes

Contents

# Log wrapper
# @!attribute [r] log
#   @return [Log] Log
# @!attribute [r] name
#   @return [String] name
class ProtonBot::LogWrapper
  attr_reader :log, :name

  # @param log [Log]
  # @param name [String]
  def initialize(log, name)
    @log  = log
    @name = name
  end

  # @param msg [String]
  # @return [LogWrapper] self
  def info(msg)
    @log.info(msg, @name)
  end

  # @param msg [String]
  # @return [LogWrapper] self
  def debug(msg)
    @log.debug(msg, @name)
  end

  # @param msg [String]
  # @return [LogWrapper] self
  def warn(msg)
    @log.warn(msg, @name)
  end

  # @param msg [String]
  # @return [LogWrapper] self
  def error(msg)
    @log.error(msg, @name)
  end

  # @param msg [String]
  # @return [LogWrapper] self
  # @return [Integer] code
  def crash(msg, code)
    @log.crash(msg, code, @name)
  end

  # @return [String] Output
  def inspect
    %(<#ProtonBot::LogWrapper:#{object_id.to_s(16)} @name='#{@name}') +
      %( @log=#{@log}>)
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
protonbot-0.3.7 lib/protonbot/log_wrapper.rb
protonbot-0.3.6 lib/protonbot/log_wrapper.rb
protonbot-0.3.5 lib/protonbot/log_wrapper.rb
protonbot-0.3.4 lib/protonbot/log_wrapper.rb
protonbot-0.3.3 lib/protonbot/log_wrapper.rb
protonbot-0.3.2 lib/protonbot/log_wrapper.rb
protonbot-0.3.1 lib/protonbot/log_wrapper.rb
protonbot-0.3.0 lib/protonbot/log_wrapper.rb
protonbot-0.2.7 lib/protonbot/log_wrapper.rb
protonbot-0.2.6 lib/protonbot/log_wrapper.rb
protonbot-0.2.5 lib/protonbot/log_wrapper.rb
protonbot-0.2.4 lib/protonbot/log_wrapper.rb
protonbot-0.2.3 lib/protonbot/log_wrapper.rb
protonbot-0.2.2 lib/protonbot/log_wrapper.rb
protonbot-0.2.1 lib/protonbot/log_wrapper.rb
protonbot-0.2.0 lib/protonbot/log_wrapper.rb
protonbot-0.1.3 lib/protonbot/log_wrapper.rb
protonbot-0.1.2 lib/protonbot/log_wrapper.rb
protonbot-0.1.1 lib/protonbot/log_wrapper.rb
protonbot-0.1.0 lib/protonbot/log_wrapper.rb