app/controllers/application_controller.rb
# Just logs the specified output message using either WARN or ERROR level logging,
# with no subsequent redirection being made.
#
# When an exception has been intercepted and the variable $! has been set,
# the level will be set to ERROR (defaults to WARN).
#
Just logs the specified output message using either WARN or ERROR level logging,
with no subsequent redirection being made.

When an exception has been intercepted and the variable $. has been set,
the level will be set to ERROR (defaults to WARN).
Just logs the specified output message using either WARN or ERROR level logging with no subsequent redirection being made . When an exception has been intercepted and the variable $ . has been set the level will be set to ERROR ( defaults to WARN ) .
def log_error( exception_or_text_msg, verbose_trace = true )
    if exception_or_text_msg.instance_of?( String )
      msg = "[W!]-- #{exception_or_text_msg}"
      logger.warn( msg )
    else
      output_message = exception_or_text_msg.respond_to?( :message ) ? exception_or_text_msg.message : exception_or_text_msg.to_s
      msg = "[E!]-- ERROR INTERCEPTED: #{output_message}"
      error_description = $!
      error_trace = exception_or_text_msg.respond_to?( :backtrace ) ? exception_or_text_msg.backtrace : '(backtrace not available)'
      logger.error( msg )
      logger.error( error_description )
      begin
        AgexMailer.exception_mail( current_user, error_description, error_trace ).deliver
        logger.info("[*I*]- e-mail error report allegedly sent.")
      rescue
        logger.warn( '[W!]-- Unable to send out notification e-mail message, Mailer not responding or not configured properly yet.' )
      end
      logger.error( error_trace ) if verbose_trace
    end
  end
def log_error ( exception_or_text_msg , verbose_trace = true ) if exception_or_text_msg . instance_of? ( String ) msg = "[W!]-- #{exception_or_text_msg}" logger . warn ( msg ) else output_message = exception_or_text_msg . respond_to? ( :message ) ? exception_or_text_msg . message : exception_or_text_msg . to_s msg = "[E!]-- ERROR INTERCEPTED: #{output_message}" error_description = $! error_trace = exception_or_text_msg . respond_to? ( :backtrace ) ? exception_or_text_msg . backtrace : '(backtrace not available)' logger . error ( msg ) logger . error ( error_description ) begin AgexMailer . exception_mail ( current_user , error_description , error_trace ) . deliver logger . info ( "[*I*]- e-mail error report allegedly sent." ) rescue logger . warn ( '[W!]-- Unable to send out notification e-mail message, Mailer not responding or not configured properly yet.' ) end logger . error ( error_trace ) if verbose_trace end end
Just logs the specified output message using either WARN or ERROR level logging,
with no subsequent redirection being made.
Just logs the specified output message using either WARN or ERROR level logging with no subsequent redirection being made .
# Send a message to the developers anyway:
exception_or_text_msg
<not_specific>
verbose_trace
<not_specific>