lib/liberty_buildpack/diagnostics/logger_factory.rb
def add(severity, message = nil, progname = nil, &block)
        if message || block_given?
          message_text = message
          program_name = progname
        else
          # progname is treated as a message if message is nil and the block is not given
          message_text = progname
          program_name = nil
        end
        # Skip stack frames in file 'logger.rb'.
        # Note: there is no way to detect the class ::Logger since caller does not include the class name and
        # the class may be reopened in arbitrary files.
        program_name ||= caller.find { |stack_frame| !(stack_frame =~ /logger\.rb/) }
        super(severity, message_text, program_name, &block)
      end
# Logs a message with a given severity.
#
# @param [String] severity the severity of the log message
# @param [Object, nil] message the message to be logged
# @param [String, nil] progname the name of the program logging the message
Logs a message with a given severity.
Logs a message with a given severity .
def add(severity, message = nil, progname = nil, &block)
        if message || block_given?
          message_text = message
          program_name = progname
        else
          message_text = progname
          program_name = nil
        end
        program_name ||= caller.find { |stack_frame| !(stack_frame =~ /logger\.rb/) }
        super(severity, message_text, program_name, &block)
      end
def add ( severity , message = nil , progname = nil , & block ) if message || block_given? message_text = message program_name = progname else message_text = progname program_name = nil end program_name ||= caller . find { | stack_frame | ! ( stack_frame =~ / logger \. rb / ) } super ( severity , message_text , program_name , & block ) end
Logs a message with a given severity.
Logs a message with a given severity .
# progname is treated as a message if message is nil and the block is not given # Skip stack frames in file 'logger.rb'. # Note: there is no way to detect the class ::Logger since caller does not include the class name and # the class may be reopened in arbitrary files.
severity
message
progname
block
progname the name of the program logging the message
progname the name of the program logging the message