class Retag::Logger

Public Instance Methods

format_message(severity, datetime, progname, msg) click to toggle source
Calls superclass method
# File lib/retag/logger.rb, line 28
def format_message(severity, datetime, progname, msg)
  super(severity, datetime, progname, "#{' ' * (@shift || 0)}#{msg}")
end
shift(spaces: 2, &block) click to toggle source
# File lib/retag/logger.rb, line 7
def shift(spaces: 2, &block)
  if block_given?
    with_shift(spaces: spaces, &block)
  else
    @shift ||= 0
    @shift += spaces
  end
end
unshift(spaces: 2) click to toggle source
# File lib/retag/logger.rb, line 16
def unshift(spaces: 2)
  @shift ||= 0
  @shift -= spaces
end
with_shift(spaces: 2) { || ... } click to toggle source
# File lib/retag/logger.rb, line 21
def with_shift(spaces: 2)
  shift(spaces: spaces)
  yield
ensure
  unshift(spaces: spaces)
end