lib/rollbar.rb
# Reports an arbitrary message to Rollbar
#
# @example
#   Rollbar.report_message("User login failed", 'info', :user_id => 123)
#
# @param message [String] The message body. This will be used to identify the message within
#   Rollbar. For best results, avoid putting variables in the message body; pass them as
#   `extra_data` instead.
# @param level [String] The level. One of: 'critical', 'error', 'warning', 'info', 'debug'
# @param extra_data [Hash] Additional data to include alongside the body. Don't use 'body' as
#   it is reserved.
Reports an arbitrary message to Rollbar
Reports an arbitrary message to Rollbar
def report_message(message, level = 'info', extra_data = {})
      return 'disabled' unless configuration.enabled
      data = message_data(message, level, extra_data)
      payload = build_payload(data)
      schedule_payload(payload)
      log_instance_link(data)
      data
    rescue => e
      report_internal_error(e)
      'error'
    end
def report_message ( message , level = 'info' , extra_data = { } ) return 'disabled' unless configuration . enabled data = message_data ( message , level , extra_data ) payload = build_payload ( data ) schedule_payload ( payload ) log_instance_link ( data ) data rescue => e report_internal_error ( e ) 'error' end
Reports an arbitrary message to Rollbar
Reports an arbitrary message to Rollbar
message
The message body. This will be used to identify the message within Rollbar. For best results, avoid putting variables in the message body; pass them as `extra_data` instead.
The message body . This will be used to identify the message within Rollbar . For best results avoid putting variables in the message body ; pass them as ` extra_data ` instead .
level
The level. One of: 'critical', 'error', 'warning', 'info', 'debug'
The level . One of : ' critical ' ' error ' ' warning ' ' info ' ' debug '
extra_data
Additional data to include alongside the body. Don't use 'body' as it is reserved.
Additional data to include alongside the body . Don ' t use ' body ' as it is reserved .
example
Rollbar.report_message("User login failed", 'info', :user_id => 123)
Rollbar . report_message ( " User login failed " ' info ' : user_id = > 123 )