org.webpieces.util.logging.Logger.error()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(272)

本文整理了Java中org.webpieces.util.logging.Logger.error()方法的一些代码示例,展示了Logger.error()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.error()方法的具体详情如下:
包路径:org.webpieces.util.logging.Logger
类名称:Logger
方法名:error

Logger.error介绍

[英]Log a message at the ERROR level.
[中]在错误级别记录消息。

代码示例

代码示例来源:origin: org.webpieces/core-util

  1. @Override
  2. public void run() {
  3. try {
  4. runnable.run();
  5. } catch(Throwable e) {
  6. log.error("Uncaught Exception", e);
  7. } finally {
  8. executeNext(key);
  9. }
  10. }
  11. }

代码示例来源:origin: org.webpieces/core-util

  1. public <T> T ack(T result, Throwable t) {
  2. if(t != null) {//on exception just ack the whole thing(as all others quite possibly will not ack at all)
  3. log.error("Exception", t);
  4. future.complete(null);
  5. }
  6. int counter = countDown.decrementAndGet();
  7. if(counter == 0) {
  8. future.complete(null);
  9. }
  10. return result;
  11. }

代码示例来源:origin: org.webpieces/core-util

  1. @Override
  2. public void run() {
  3. try {
  4. runImpl();
  5. } catch(Throwable e) {
  6. log.error("Exception running runnable", e);
  7. }
  8. }

代码示例来源:origin: org.webpieces/core-channelmanager2

  1. @Override
  2. public void farEndClosed(Channel channel) {
  3. try {
  4. dataListener.farEndClosed(channel);
  5. } catch(Throwable e) {
  6. log.error("Exception", e);
  7. }
  8. }

代码示例来源:origin: org.webpieces/http-frontend

  1. @Override
  2. public void applyBackPressure(Channel channel) {
  3. log.error("Need to apply backpressure", new RuntimeException("demonstrates how we got here"));
  4. processor.applyWriteBackPressure(channel);
  5. }

代码示例来源:origin: org.webpieces/http-common

  1. @Override
  2. public void failure(Channel channel, ByteBuffer data, Exception e) {
  3. log.error("Failure on channel="+channel, e);
  4. // Call failure on every protocol
  5. for(Map.Entry<Protocol, DataListener> entry: dataListenerMap.entrySet()) {
  6. entry.getValue().failure(channel, data, e);
  7. }
  8. }

代码示例来源:origin: org.webpieces/core-channelmanager2

  1. @Override
  2. public void failure(Channel channel, ByteBuffer data, Exception e) {
  3. try {
  4. dataListener.failure(channel, data, e);
  5. } catch(Throwable ee) {
  6. log.error("Exception caught trying to handle the other exception(the other exception IS more important)", ee);
  7. }
  8. }

代码示例来源:origin: org.webpieces/core-channelmanager2

  1. public void farEndClosed(Channel channel) {
  2. try {
  3. synchronized(this) {
  4. if(closedAlready)
  5. return;
  6. closedAlready = true;
  7. }
  8. listener.farEndClosed(channel);
  9. } catch (Throwable e) {
  10. log.error("Exception", e);
  11. }
  12. }

代码示例来源:origin: org.webpieces/core-channelmanager2

  1. public void failure(Channel channel, ByteBuffer data, Exception e) {
  2. try {
  3. listener.failure(channel, data, e);
  4. } catch (Throwable ee) {
  5. log.error("Exception processing other exception", ee);
  6. }
  7. }

代码示例来源:origin: org.webpieces/core-channelmanager2

  1. public final void processRegistrations() {
  2. try {
  3. run();
  4. future.complete(null);
  5. } catch(Throwable e) {
  6. log.error("Exception completing", e);
  7. future.completeExceptionally(e);
  8. }
  9. }

代码示例来源:origin: org.webpieces/core-channelmanager2

  1. @Override
  2. public CompletableFuture<Void> incomingData(Channel channel, ByteBuffer b) {
  3. try {
  4. return dataListener.incomingData(channel, b);
  5. } catch(Throwable e) {
  6. log.error("Exception", e);
  7. CompletableFuture<Void> fut = new CompletableFuture<Void>();
  8. fut.completeExceptionally(e);
  9. return fut;
  10. }
  11. }

代码示例来源:origin: org.webpieces/core-channelmanager2

  1. /**
  2. * @param fromAddr
  3. * @param e
  4. */
  5. private void fireFailure(InetSocketAddress fromAddr, ByteBuffer data, Throwable e) {
  6. try {
  7. listener.failure(this, fromAddr, data, e);
  8. } catch(Throwable ee) {
  9. log.error(id+"Exception notifying client of exception", ee);
  10. }
  11. }

代码示例来源:origin: org.webpieces/core-channelmanager2

  1. public CompletableFuture<Void> incomingData(Channel channel, ByteBuffer b) {
  2. try {
  3. return listener.incomingData(channel, b);
  4. } catch (Throwable e) {
  5. log.error("Exception", e);
  6. CompletableFuture<Void> future = new CompletableFuture<>();
  7. future.completeExceptionally(e);
  8. return future;
  9. }
  10. }

代码示例来源:origin: org.webpieces/http1_1-client

  1. @Override
  2. public void failure(Channel channel, ByteBuffer data, Exception e) {
  3. log.error("Failure on channel="+channel, e);
  4. while(!responsesToComplete.isEmpty()) {
  5. HttpResponseListener listener = responsesToComplete.poll();
  6. if(listener != null) {
  7. listener.failure(e);
  8. }
  9. }
  10. }

代码示例来源:origin: org.webpieces/http-frontend2

  1. public void farEndClosed(FrontendSocketImpl socket) {
  2. log.error("far end closed="+socket);
  3. Http2ServerEngine engine = socket.getHttp2Engine();
  4. engine.farEndClosed();
  5. }

代码示例来源:origin: org.webpieces/http-frontend2

  1. public CompletableFuture<Void> incomingData(FrontendSocketImpl socket, ByteBuffer buf) {
  2. Memento state = socket.getHttp1_1ParseState();
  3. int newDataSize = buf.remaining();
  4. state = parse(socket, buf);
  5. return processWithBackpressure(socket, newDataSize, state.getNumBytesJustParsed()).exceptionally(t -> {
  6. log.error("Exception", t);
  7. socket.close("Exception so closing http1.1 socket="+t.getMessage());
  8. return null;
  9. });
  10. }

代码示例来源:origin: org.webpieces/http-router

  1. public Void finalFailure(ResponseStreamer responseCb, Throwable e, RequestContext requestCtx) {
  2. log.error("This is a final(secondary failure) trying to render the Internal Server Error Route", e);
  3. if(portConfig == null)
  4. portConfig = portCallback.fetchPortConfig();
  5. ResponseProcessor processor = new ResponseProcessor(requestCtx, reverseRoutes, reverseTranslator, null, responseCb, portConfig);
  6. processor.failureRenderingInternalServerErrorPage(e);
  7. return null;
  8. }

代码示例来源:origin: org.webpieces/http-common

  1. private void preconditions() {
  2. // If we haven't gotten the settings, let's wait a little bit because another thread
  3. // might have the settings frame and hasn't gotten around to processing it yet.
  4. try {
  5. Http2EngineImpl.log.info("Waiting for settings frame to arrive");
  6. if (!this.http2EngineImpl.settingsLatch.await(500, TimeUnit.MILLISECONDS))
  7. throw new GoAwayError(this.http2EngineImpl.lastClosedRemoteOriginatedStream().orElse(0), Http2ErrorCode.PROTOCOL_ERROR, Http2EngineImpl.wrapperGen.emptyWrapper());
  8. } catch (InterruptedException e) {
  9. Http2EngineImpl.log.error("Caught exception while waiting for settings frame", e);
  10. throw new GoAwayError(this.http2EngineImpl.lastClosedRemoteOriginatedStream().orElse(0), Http2ErrorCode.PROTOCOL_ERROR, Http2EngineImpl.wrapperGen.emptyWrapper());
  11. }
  12. }

代码示例来源:origin: org.webpieces/embeddablehttpproxy

  1. public Void processError(ResponseSender responseSender, HttpRequest req, Throwable e) {
  2. log.error("could not process req="+req+" from responseSender="+responseSender+" due to exception", e);
  3. if(e.getCause() instanceof UnresolvedAddressException) {
  4. HttpClientException exc = new HttpClientException("Client gave a bad address to connect to", KnownStatusCode.HTTP_404_NOTFOUND, e);
  5. badResponse.sendServerResponse(responseSender, exc);
  6. } else {
  7. HttpServerException exc = new HttpServerException("Server has a bug", KnownStatusCode.HTTP_500_INTERNAL_SVR_ERROR, e);
  8. badResponse.sendServerResponse(responseSender, exc);
  9. }
  10. responseSender.close();
  11. return null;
  12. }

代码示例来源:origin: org.webpieces/http-common

  1. private CompletableFuture<ResponseId> actuallySendResponse(HttpResponse response, Stream stream, boolean isComplete) {
  2. return sendHeaderFrames(responseToHeaders(response), stream)
  3. .thenAccept(v -> {
  4. // Don't send an empty dataframe that is not completing.
  5. if (response.getBodyNonNull().getReadableSize() != 0 || isComplete)
  6. sendDataFrames(response.getBodyNonNull(), isComplete, stream, false);
  7. })
  8. .thenApply(v -> stream.getResponseId()).exceptionally(e -> {
  9. log.error("can't send header frames", e);
  10. return stream.getResponseId();
  11. });
  12. }

相关文章