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

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

本文整理了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

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

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

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

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

  1. public CompletableFuture<RESP> get() {
  2. log.trace(() -> "key:"+key+" start virtual single thread. ");
  3. try {
  4. RESP resp = processor.get();
  5. return CompletableFuture.completedFuture(resp);
  6. } catch (Throwable e) {
  7. CompletableFuture<RESP> future = new CompletableFuture<>();
  8. future.completeExceptionally(e);
  9. return future;
  10. }
  11. }
  12. };

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

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

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

  1. private void doThreadWork() {
  2. while(!shutDownThread) {
  3. readPackets();
  4. }
  5. log.trace(()->id+"reader thread ending");
  6. }

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

  1. protected synchronized CompletableFuture<Channel> connectImpl(SocketAddress addr) {
  2. CompletableFuture<Channel> promise = new CompletableFuture<>();
  3. try {
  4. apiLog.trace(()->this+"Basic.connect called-addr="+addr);
  5. channel.connect(addr);
  6. promise.complete(this);
  7. } catch(Exception e) {
  8. promise.completeExceptionally(e);
  9. }
  10. return promise;
  11. }

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

  1. public CompileClassMeta getOrCreateApplicationClass(String name, VirtualFile current) {
  2. CompileClassMeta applicationClass = classes.get(name);
  3. if(applicationClass != null)
  4. return applicationClass;
  5. else if(current == null)
  6. return null;
  7. log.trace(()->"Adding class="+name+" to ApplicationClassMgr");
  8. CompileClassMeta appClass = new CompileClassMeta(name, current, config);
  9. classes.put(name, appClass);
  10. return appClass;
  11. }

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

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

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

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

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

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

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

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

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

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

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

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

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

  1. public CompletableFuture<Void> bind(SocketAddress addr) {
  2. if(!(addr instanceof InetSocketAddress))
  3. throw new IllegalArgumentException(this+"Can only bind to InetSocketAddress addressses");
  4. apiLog.trace(()->this+"Basic.bind called addr="+addr);
  5. try {
  6. bindImpl(addr);
  7. return CompletableFuture.completedFuture(null);
  8. } catch (IOException e) {
  9. throw new NioException(e);
  10. }
  11. }

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

  1. public synchronized void disconnect() {
  2. apiLog.trace(()->this+"Basic.disconnect called");
  3. try {
  4. channelState = ChannelState.CLOSED;
  5. channel.disconnect();
  6. } catch(IOException e) {
  7. throw new NioException(e);
  8. }
  9. }

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

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

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

  1. public CompletableFuture<Channel> unregisterForReads() {
  2. apiLog.trace(()->this+"Basic.unregisterForReads called");
  3. try {
  4. return selMgr.unregisterChannelForRead(this).thenApply(v -> this);
  5. } catch (IOException e) {
  6. throw new NioException(e);
  7. } catch (InterruptedException e) {
  8. throw new NioException(e);
  9. }
  10. }

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

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

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

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

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

  1. @Override
  2. public CompletableFuture<Void> beginHandshake() {
  3. mem.compareSet(ConnectionState.NOT_STARTED, ConnectionState.CONNECTING);
  4. SSLEngine sslEngine = mem.getEngine();
  5. log.trace(()->mem+"start handshake");
  6. try {
  7. sslEngine.beginHandshake();
  8. } catch (SSLException e) {
  9. throw new AsyncSSLEngineException(e);
  10. }
  11. return sendHandshakeMessage();
  12. }

相关文章