lib/google_logger.rb
# Creates a new entry for an exception which includes exception message, class and backtrace
#
# @param [StandardError] exception exception to be logged
#
# return [Boolean] `true` if the entry was successfully written
Creates a new entry for an exception which includes exception message, class and backtrace
Creates a new entry for an exception which includes exception message class and backtrace
def log_exception(exception)
      payload = {
        message: exception.message,
        exception: exception.class.name,
        bactrace: exception.backtrace&.first(configuration.backtrace_length)
      }
      create_entry(payload, log_name: 'error', severity: :ERROR)
    rescue StandardError => e
      log_google_logger_error(e)
    end
def log_exception ( exception ) payload = { message : exception . message , exception : exception . class . name , bactrace : exception . backtrace &. first ( configuration . backtrace_length ) } create_entry ( payload , log_name : 'error' , severity : :ERROR ) rescue StandardError => e log_google_logger_error ( e ) end
Creates a new entry for an exception which includes exception message, class and backtrace
Creates a new entry for an exception which includes exception message class and backtrace
exception
<not_specific>
<not_specific>
exception exception to be logged return [Boolean] `true` if the entry was successfully written
exception exception to be logged return [ Boolean ] ` true ` if the entry was successfully written