Log an error into the span

 @param e [Exception] The exception to be logged
541290
def add_error(e)
      @data[:error] = true

      if @data.key?(:ec)
        @data[:ec] = @data[:ec] + 1
      else
        @data[:ec] = 1
      end

      # If a valid exception has been passed in, log the information about it
      # In case of just logging an error for things such as HTTP client 5xx
      # responses, an exception/backtrace may not exist.
      if e
        if e.backtrace.is_a?(Array)
          add_stack(stack: e.backtrace)
        end

        if HTTP_SPANS.include?(@data[:n])
          set_tags(:http => { :error => "#{e.class}: #{e.message}" })
        else
          log(:error, Time.now, { :message => e.message, :parameters => e.class.to_s })
        end
        e.instance_variable_set(:@instana_logged, true)
      end
      self
    end
257873
private static void printException(Exception e) {

        if (e instanceof InstallationCancelledException) {
            System.out.println("Installation cancelled.");
            return;
        }

        boolean recognized = false;
        String msg = "ERROR: ";
        if (e instanceof InstallationFailedException) {
            msg += "Installation failed: " + e.getMessage();
            recognized = true;
        } else if (e instanceof OptionValidationException) {
            OptionValidationException ove = (OptionValidationException) e;
            msg +=
                    "Bad value for '" + ove.getOptionId() + "': "
                            + e.getMessage();
            recognized = true;
        }

        if (recognized) {
            System.err.println(msg);
            if (e.getCause() != null) {
                System.err.println("Caused by: ");
                e.getCause().printStackTrace(System.err);
            }
        } else {
            System.err.println(msg + "Unexpected error; installation aborted.");
            e.printStackTrace();
        }
    }
522567
def logged_exception(self, e):
        
        if str(e) not in self._errors:
            self._errors.append(str(e))

        self.set_error_state()
        self.buildstate.state.exception_type = str(e.__class__.__name__)
        self.buildstate.state.exception = str(e)
479263
private void exception(Throwable e)
    {
        try
        {
            _persistent=false;
            int error_code=HttpResponse.__500_Internal_Server_Error;
            
            if (e instanceof HttpException)
            {
                error_code=((HttpException)e).getCode();
                
                if (_request==null)
                    log.warn(e.toString());
                else
                    log.warn(_request.getRequestLine()+" "+e.toString());
                log.debug(LogSupport.EXCEPTION,e);
            }
            else if (e instanceof EOFException)
            {
                LogSupport.ignore(log,e);
                return;
            }
            else
            {
                _request.setAttribute("javax.servlet.error.exception_type",e.getClass());
                _request.setAttribute("javax.servlet.error.exception",e);
                
                if (_request==null)
                    log.warn(LogSupport.EXCEPTION,e);
                else
                    log.warn(_request.getRequestLine(),e);
            }
            
            if (_response != null && !_response.isCommitted())
            {
                _response.reset();
                _response.removeField(HttpFields.__TransferEncoding);
                _response.setField(HttpFields.__Connection,HttpFields.__Close);
                _response.sendError(error_code);
            }
        }
        catch(Exception ex)
        {
            LogSupport.ignore(log,ex);
        }
    }
1339715
public void logClosedException(Exception e) {
        // Note: this may be a normal occurance so don't log error, just debug.
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Connection closed with exception: " + e.getMessage());
        }
    }
395853
public void exception(Throwable e) {
    final String msg = e.getMessage();
    log(Level.SEVERE, msg != null ? msg : "An exception occurred.", e);
  }
1028509
protected void logError(Exception e, boolean logToErrorChannel) {

        if (logToErrorChannel) {
            LOG.error(e.getLocalizedMessage(), e);
        } else {
            LOG.info(e.getLocalizedMessage(), e);
        }
        // if an error was logged make sure that the flag to schedule a reload is reset
        setReloadScheduled(false);
    }
1047201
private void logRunException(final Exception e) {
    if (shutDown) {
      getLogger().debug("Exception occurred during shutdown", e);
    } else {
      getLogger().warn("Problem handling memcached IO", e);
    }
  }
561181
function logError(e) {
  var msg = typeof e === 'string' ? e : e.message;

  // esprima.parse errors are in the format 'Line 123: Unexpected token &'
  // we support both formats since users might replace the parser
  if ((/Line \d+:/).test(msg)) {
    // convert into "Error: <filepath>:<line> <error_message>"
    msg = 'Error: ' + msg.replace(/[^\d]+(\d+): (.+)/, e.file + ':$1 $2');
  } else {
    // babylon.parse errors are in the format 'Unexpected token (0:4)'
    var m = (/^([^\(]+)\s\((\d+):(\d+)\)/).exec(msg);
    if (m) {
      // convert into "Error: <filepath>:<line>:<char> <error_message>"
      msg = 'Error: ' + e.file + ':' + m[2] + ':' + m[3] + ' ' + m[1];
    } else if (msg.indexOf('Error:') < 0) {
      msg = 'Error: ' + (e.file ? e.file + ' ' : '') + msg;
    }
  }

  // set the error flag to true to use an exit code !== 0
  exports.exitCode = 1;

  // we don't call console.error directly to make it possible to mock during
  // unit tests
  exports.stderr.write(msg + '\n');

  if (e.stack) {
    exports.stderr.write(e.stack + '\n');
  }
}
945937
public void error(String msg, Throwable e) {
        doLog(msg, LOG_ERROR, null, e);
    }
379590
@Override
	public void log(Exception e, Object... elements) {
		StringBuilder sb = buildMsg(Level.ERROR, elements);
		context.log(sb.toString(),e);
	}
531365
public void error(CharSequence message, Throwable e) {
    log(Level.SEVERE, message, e);
  }
1053409
private static void logAndThrowException(String message, PyException e) throws Exception {
        LOGGER.error(message, e);
        throw new Exception(message + ":\n" + PythonHelper.getMessage(e));
    }
1169914
public static void logError(final Logger logger, final Error e)
	{
		logger.logError(Level.ERROR, "Unexpected Error", e);
	}
1309186
def __logfile_error(self, e):
        
        from sys import stderr
        msg = "Warning, error writing log file %s: %s\n"
        msg = msg % (self.logfile, str(e))
        stderr.write(DebugLog.log_text(msg))
        self.logfile = None
        self.fd      = None
1154424
public void setConfigException(Exception e)
  {
    log.log(Level.FINER, e.toString(), e);
  }
82591
public void logException(Throwable e, String message) {
        logMessage(IStatus.ERROR, message, e);
    }