lib/utilrb/logger/indent.rb
# Adds a certain number number of spaces to the current indentation level
#
# @overload nest(size)
#   Permanently adds a number of spaces to the current indentation
#   @param [Integer] size the number of spaces that should be added to
#     {nest_size}
#
# @overload nest(size) { }
#   Adds a number of spaces to the current indentation for the duration of
#   the block, and restores the original indentation afterwards.
#
#   @param [Integer] size the number of spaces that should be added to
#     {nest_size}
#
# @overload nest(size, log_level) { }
#   Shortcut for
#   @example
#     
#     logger.send(log_level) do
#       logger.nest(size) do
#         ...
#       end
#     end
#
Adds a certain number number of spaces to the current indentation level
Adds a certain number number of spaces to the current indentation level
def nest(size, log_level = nil)
        if log_level
            send(log_level) do
                nest(size) do
                    yield
                end
                return
            end
        end
        if block_given?
            begin
                current = self.nest_size
                self.nest_size += size
                yield
            ensure
                self.nest_size = current
            end
        else
            self.nest_size += size
        end
    end
def nest ( size , log_level = nil ) if log_level send ( log_level ) do nest ( size ) do yield end return end end if block_given? begin current = self . nest_size self . nest_size += size yield ensure self . nest_size = current end else self . nest_size += size end end
Adds a certain number number of spaces to the current indentation level
Adds a certain number number of spaces to the current indentation level
size
<not_specific>
log_level
<not_specific>
overload
nest(size) Permanently adds a number of spaces to the current indentation @param [Integer] size the number of spaces that should be added to {nest_size}
nest ( size ) Permanently adds a number of spaces to the current indentation @param [ Integer ] size the number of spaces that should be added to { nest_size }
overload
nest(size) { } Adds a number of spaces to the current indentation for the duration of the block, and restores the original indentation afterwards. @param [Integer] size the number of spaces that should be added to {nest_size}
nest ( size ) { } Adds a number of spaces to the current indentation for the duration of the block and restores the original indentation afterwards . @param [ Integer ] size the number of spaces that should be added to { nest_size }
overload
nest(size, log_level) { } Shortcut for @example logger.send(log_level) do logger.nest(size) do ...
nest ( size log_level ) { } Shortcut for @example logger . send ( log_level ) do logger . nest ( size ) do ...