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

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

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

Logger.trace介绍

[英]Log a message at the TRACE level.
[中]在跟踪级别记录消息。

代码示例

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

private void logAndCheck(ByteBuffer encryptedData, SSLEngineResult result, ByteBuffer outBuffer, Status status, HandshakeStatus hsStatus, int i) {
  final ByteBuffer data = encryptedData;
  log.trace(()->mem+"[sockToEngine] unwrap done pos="+data.position()+" lim="+
        data.limit()+" status="+status+" hs="+hsStatus);
  if(i > 1000) {
    throw new RuntimeException(this+"Bug, stuck in loop, encryptedData="+encryptedData+" outBuffer="+outBuffer+
        " hsStatus="+hsStatus+" status="+status);
  } else if(status == Status.BUFFER_UNDERFLOW) {
    final ByteBuffer data1 = encryptedData;
    log.trace(()->"buffer underflow. data="+data1.remaining());
  }
}

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

private void logTrace(ByteBuffer encryptedData, Status status, HandshakeStatus hsStatus) {
  log.trace(()->mem+"[sockToEngine] reset pos="+encryptedData.position()+" lim="+encryptedData.limit()+" status="+status+" hs="+hsStatus);
}

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

public CompletableFuture<RESP> get() {
    log.trace(() -> "key:"+key+" start virtual single thread. ");
    try {
      RESP resp = processor.get();
      return CompletableFuture.completedFuture(resp);
    } catch (Throwable e) {
      CompletableFuture<RESP> future = new CompletableFuture<>();
      future.completeExceptionally(e);
      return future;
    }
  }
};

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

/**
 * @throws IOException 
 * @see org.webpieces.nio.api.channels.DatagramChannel#oldWrite(java.net.SocketAddress, java.nio.ByteBuffer)
 */
private void writeImpl(SocketAddress addr, ByteBuffer b) throws IOException {
  if(socket == null)
    throw new IllegalStateException(id+"Must bind socket before any operations can be called");
  DatagramPacket packet = new DatagramPacket(b.array(), b.position(), b.limit()-b.position(), addr);
  
  log.trace(()->"size="+(b.limit()-b.position())+" addr="+addr);
  
  
  socket.send(packet);
}

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

private void doThreadWork() {
  while(!shutDownThread) {
    readPackets();
  }
  log.trace(()->id+"reader thread ending");
}

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

protected synchronized CompletableFuture<Channel> connectImpl(SocketAddress addr) {
  CompletableFuture<Channel> promise = new CompletableFuture<>();
  
  try {
    apiLog.trace(()->this+"Basic.connect called-addr="+addr);
    
    channel.connect(addr);
    
    promise.complete(this);
  } catch(Exception e) {
    promise.completeExceptionally(e);
  }
  
  return promise;
}

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

public CompileClassMeta getOrCreateApplicationClass(String name, VirtualFile current) {
  CompileClassMeta applicationClass = classes.get(name);
  if(applicationClass != null)
    return applicationClass;
  else if(current == null)
    return null;
  log.trace(()->"Adding class="+name+" to ApplicationClassMgr");
  CompileClassMeta appClass = new CompileClassMeta(name, current, config);
  classes.put(name, appClass);
  return appClass;
}

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

private <RESP> CompletableFuture<RESP> release(RESP v, Throwable e, String key) {
  log.trace(() -> "key:"+key+" end virtual single thread");
  //immediately release when future is complete
  queue.releasePermit();
  CompletableFuture<RESP> future = new CompletableFuture<RESP>();
  if (e != null) {
    future.completeExceptionally(e);
  } else
    future.complete(v);
  
  return future;
}

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

@Override
public void farEndClosed(Channel channel) {
  log.trace(()->"far end closed. channel="+channel);
  processor.farEndClosed(channel);
}

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

private void registerForWrites() {
  log.trace(()->this+"registering channel for write msg. size="+dataToBeWritten.size());
  selMgr.registerSelectableChannel(this, SelectionKey.OP_WRITE, null);
}

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

private void logTrace1(ByteBuffer encryptedInData, HandshakeStatus hsStatus) {
  log.trace(()->mem+"[sockToEngine] going to unwrap pos="+encryptedInData.position()+
        " lim="+encryptedInData.limit()+" hsStatus="+hsStatus+" cached="+mem.getCachedToProcess());
}

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

/**
 * Unfortunately, previously, a registered Socket cannot close if the PollingThread is
 * hung on the selector.  A registered socket is closed on entry to the 
 * select or selectNow function, therefore, we just wake up the selector
 * so we reenter him to close the socket.
 * 
 * Also, this is used to wakeup the selector to process registrations!!!
 */
public void wakeUpSelector() {
  log.trace(()->"Wakeup selector to enable close or registers");
  needCloseOrRegister = true;
  selector.wakeup();
}
public Object getThread() {

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

private void write(SelectionKey key, ChannelInfo info) throws IOException, InterruptedException {
  log.trace(()->info.getChannel()+"writing data");
  
  BasChannelImpl channel = (BasChannelImpl)info.getChannel();        
  
  log.trace(()->channel+"notifying channel of write");
  channel.writeAll();  
}

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

public CompletableFuture<Void> bind(SocketAddress addr) {
  if(!(addr instanceof InetSocketAddress))
    throw new IllegalArgumentException(this+"Can only bind to InetSocketAddress addressses");
  apiLog.trace(()->this+"Basic.bind called addr="+addr);
  
  try {
    bindImpl(addr);
    return CompletableFuture.completedFuture(null);
  } catch (IOException e) {
    throw new NioException(e);
  }
}

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

public synchronized void disconnect() {
  apiLog.trace(()->this+"Basic.disconnect called");
  
  try {
    channelState = ChannelState.CLOSED;
    channel.disconnect();
  } catch(IOException e) {
    throw new NioException(e);
  }
}

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

public boolean runDelayedAction() {
  log.trace(()->channel+"Closing channel.");
  
  try {
    channel.closeImpl();
    
    //must wake up selector or socket will not send the TCP FIN packet!!!!! 
    //The above only happens on the client thread...on selector thread, close works fine.
    channel.wakeupSelector();
    
    handler.complete(null);
  } catch(Exception e) {
    log.error(channel+"Exception occurred", e);
    handler.completeExceptionally(e);
  }
  return true;
}

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

public CompletableFuture<Channel> unregisterForReads() {
  apiLog.trace(()->this+"Basic.unregisterForReads called");		
  try {
    return selMgr.unregisterChannelForRead(this).thenApply(v -> this);
  } catch (IOException e) {
    throw new NioException(e);
  } catch (InterruptedException e) {
    throw new NioException(e);
  }
}

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

/**
 * @see org.webpieces.nio.api.channels.RegisterableChannel#getLocalAddress()
 */
public InetSocketAddress getLocalAddress() {
  if(!socket.isBound())
    throw new IllegalStateException(id+"Must bind socket before any operations can be called");
  log.trace(()->"get local="+socket.getLocalPort());
  return new InetSocketAddress(socket.getLocalAddress(), socket.getLocalPort());
}

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

private void acceptSocket(SelectionKey key, ChannelInfo info) throws IOException {
  log.trace(() -> info.getChannel()+"Incoming Connection="+key);
  
  BasTCPServerChannel channel = (BasTCPServerChannel)info.getChannel();
  channel.accept(channel.getChannelCount());
}

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

@Override
public CompletableFuture<Void> beginHandshake() {
  mem.compareSet(ConnectionState.NOT_STARTED, ConnectionState.CONNECTING);
  SSLEngine sslEngine = mem.getEngine();
  
  log.trace(()->mem+"start handshake");
  try {
    sslEngine.beginHandshake();
  } catch (SSLException e) {
    throw new AsyncSSLEngineException(e);
  }
  
  return sendHandshakeMessage();
}

相关文章