io.vertx.core.logging.Logger.debug()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(11.4k)|赞(0)|评价(0)|浏览(308)

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

Logger.debug介绍

暂无

代码示例

代码示例来源:origin: eclipse-vertx/vert.x

  1. private static void logInternal(final String perms) {
  2. if (perms != null && log.isDebugEnabled()) {
  3. log.debug("You are running on Windows and POSIX style file permissions are not supported");
  4. }
  5. }

代码示例来源:origin: eclipse-vertx/vert.x

  1. @Override
  2. protected BlockingAction<Void> chownInternal(String path, String user, String group, Handler<AsyncResult<Void>> handler) {
  3. if (group != null && log.isDebugEnabled()) {
  4. log.debug("You are running on Windows and POSIX style file ownership is not supported");
  5. }
  6. return super.chownInternal(path, user, group, handler);
  7. }
  8. }

代码示例来源:origin: eclipse-vertx/vert.x

  1. @Override
  2. protected BlockingAction<Void> chmodInternal(String path, String perms, String dirPerms,
  3. Handler<AsyncResult<Void>> handler) {
  4. Objects.requireNonNull(path);
  5. Objects.requireNonNull(perms);
  6. logInternal(perms);
  7. logInternal(dirPerms);
  8. if (log.isDebugEnabled()) {
  9. log.debug("You are running on Windows and POSIX style file permissions are not supported!");
  10. }
  11. return new BlockingAction<Void>(handler) {
  12. @Override
  13. public Void perform() {
  14. return null;
  15. }
  16. };
  17. }

代码示例来源:origin: eclipse-vertx/vert.x

  1. synchronized void writeMessage(ClusteredMessage message) {
  2. if (connected) {
  3. Buffer data = message.encodeToWire();
  4. if (metrics != null) {
  5. metrics.messageWritten(message.address(), data.length());
  6. }
  7. socket.write(data);
  8. } else {
  9. if (pending == null) {
  10. if (log.isDebugEnabled()) {
  11. log.debug("Not connected to server " + serverID + " - starting queuing");
  12. }
  13. pending = new ArrayDeque<>();
  14. }
  15. pending.add(message);
  16. }
  17. }

代码示例来源:origin: eclipse-vertx/vert.x

  1. void close() {
  2. if (timeoutID != -1) {
  3. vertx.cancelTimer(timeoutID);
  4. }
  5. if (pingTimeoutID != -1) {
  6. vertx.cancelTimer(pingTimeoutID);
  7. }
  8. try {
  9. client.close();
  10. } catch (Exception ignore) {
  11. }
  12. // The holder can be null or different if the target server is restarted with same serverid
  13. // before the cleanup for the previous one has been processed
  14. if (eventBus.connections().remove(serverID, this)) {
  15. if (log.isDebugEnabled()) {
  16. log.debug("Cluster connection closed for server " + serverID);
  17. }
  18. }
  19. }

代码示例来源:origin: eclipse-vertx/vert.x

  1. private void handshakeComplete(ChannelHandlerContext ctx, FullHttpResponse response) {
  2. handshaking = false;
  3. ChannelHandler handler = ctx.pipeline().get(HttpContentDecompressor.class);
  4. if (handler != null) {
  5. // remove decompressor as its not needed anymore once connection was upgraded to websockets
  6. ctx.pipeline().remove(handler);
  7. }
  8. WebSocketImpl webSocket = new WebSocketImpl(vertx, Http1xClientConnection.this, supportsContinuation,
  9. options.getMaxWebsocketFrameSize(),
  10. options.getMaxWebsocketMessageSize());
  11. ws = webSocket;
  12. handshaker.finishHandshake(chctx.channel(), response);
  13. ws.subProtocol(handshaker.actualSubprotocol());
  14. context.executeFromIO(v -> {
  15. log.debug("WebSocket handshake complete");
  16. if (metrics != null ) {
  17. webSocket.setMetric(metrics.connected(endpointMetric, metric(), webSocket));
  18. }
  19. webSocket.registerHandler(vertx.eventBus());
  20. wsConnect.handle(webSocket);
  21. });
  22. }
  23. }

代码示例来源:origin: eclipse-vertx/vert.x

  1. if (connectError && (remainingAttempts > 0 || remainingAttempts == -1)) {
  2. context.executeFromIO(v -> {
  3. log.debug("Failed to create connection. Will retry in " + options.getReconnectInterval() + " milliseconds");

代码示例来源:origin: eclipse-vertx/vert.x

  1. log.debug("got request: " + toHex(buffer));
  2. log.debug("auth failed");
  3. log.debug("writing: " + toHex(errorResponse));
  4. socket.write(errorResponse);
  5. socket.close();
  6. log.debug("connect: " + host + ":" + port);
  7. socket.handler(null);
  8. lastUri = host + ":" + port;
  9. log.debug("connecting to " + host + ":" + port);
  10. NetClient netClient = vertx.createNetClient(new NetClientOptions());
  11. netClient.connect(port, host, result -> {
  12. if (result.succeeded()) {
  13. log.debug("writing: " + toHex(connectResponse));
  14. socket.write(connectResponse);
  15. log.debug("connected, starting pump");
  16. NetSocket clientSocket = result.result();
  17. socket.closeHandler(v -> clientSocket.close());
  18. log.error("exception", result.cause());
  19. socket.handler(null);
  20. log.debug("writing: " + toHex(errorResponse));
  21. socket.write(errorResponse);
  22. socket.close();
  23. log.debug("socks4a server started");
  24. return this;

代码示例来源:origin: eclipse-vertx/vert.x

  1. log.debug("got request: " + toHex(buffer));
  2. } else if(addressType == 3) {
  3. int stringLen = buffer2.getUnsignedByte(4);
  4. log.debug("string len " + stringLen);
  5. if (buffer2.length() != 7 + stringLen) {
  6. throw new IllegalStateException("format error in client request (attribute type domain name), got " + toHex(buffer2));
  7. log.debug("got request: " + toHex(buffer2));
  8. log.debug("connect: " + host + ":" + port);
  9. socket.handler(null);
  10. lastUri = host + ":" + port;
  11. log.debug("connecting to " + host + ":" + port);
  12. NetClient netClient = vertx.createNetClient(new NetClientOptions());
  13. netClient.connect(port, host, result -> {
  14. if (result.succeeded()) {
  15. log.debug("writing: " + toHex(connectResponse));
  16. socket.write(connectResponse);
  17. log.debug("connected, starting pump");
  18. NetSocket clientSocket = result.result();
  19. socket.closeHandler(v -> clientSocket.close());
  20. log.error("exception", result.cause());
  21. socket.handler(null);
  22. log.debug("writing: " + toHex(errorResponse));
  23. socket.write(errorResponse);
  24. socket.close();

代码示例来源:origin: eclipse-vertx/vert.x

  1. private synchronized void connected(NetSocket socket) {
  2. this.socket = socket;
  3. connected = true;
  4. socket.exceptionHandler(t -> close());
  5. socket.closeHandler(v -> close());
  6. socket.handler(data -> {
  7. // Got a pong back
  8. vertx.cancelTimer(timeoutID);
  9. schedulePing();
  10. });
  11. // Start a pinger
  12. schedulePing();
  13. if (pending != null) {
  14. if (log.isDebugEnabled()) {
  15. log.debug("Draining the queue for server " + serverID);
  16. }
  17. for (ClusteredMessage message : pending) {
  18. Buffer data = message.encodeToWire();
  19. if (metrics != null) {
  20. metrics.messageWritten(message.address(), data.length());
  21. }
  22. socket.write(data);
  23. }
  24. }
  25. pending = null;
  26. }

代码示例来源:origin: eclipse-vertx/vert.x

  1. } else {
  2. Throwable e = ar.cause();
  3. log.debug("exception", e);
  4. int status;
  5. if (e instanceof UnknownHostException) {

代码示例来源:origin: io.vertx/vertx-core

  1. private static void logInternal(final String perms) {
  2. if (perms != null && log.isDebugEnabled()) {
  3. log.debug("You are running on Windows and POSIX style file permissions are not supported");
  4. }
  5. }

代码示例来源:origin: io.vertx/vertx-core

  1. @Override
  2. protected BlockingAction<Void> chownInternal(String path, String user, String group, Handler<AsyncResult<Void>> handler) {
  3. if (group != null && log.isDebugEnabled()) {
  4. log.debug("You are running on Windows and POSIX style file ownership is not supported");
  5. }
  6. return super.chownInternal(path, user, group, handler);
  7. }
  8. }

代码示例来源:origin: io.vertx/vertx-core

  1. @Override
  2. protected BlockingAction<Void> chmodInternal(String path, String perms, String dirPerms,
  3. Handler<AsyncResult<Void>> handler) {
  4. Objects.requireNonNull(path);
  5. Objects.requireNonNull(perms);
  6. logInternal(perms);
  7. logInternal(dirPerms);
  8. if (log.isDebugEnabled()) {
  9. log.debug("You are running on Windows and POSIX style file permissions are not supported!");
  10. }
  11. return new BlockingAction<Void>(handler) {
  12. @Override
  13. public Void perform() {
  14. return null;
  15. }
  16. };
  17. }

代码示例来源:origin: vert-x3/vertx-web

  1. private void echoRequest(SockJSSocket sock, Buffer requestBuffer) {
  2. log.debug("Server received " + requestBuffer);
  3. log.debug("Server sending " + requestBuffer);
  4. sock.write(requestBuffer);
  5. sock.close();
  6. }

代码示例来源:origin: vert-x3/vertx-web

  1. private void deliverMessage(SockJSSocket sock, String address, Message message) {
  2. JsonObject envelope = new JsonObject().put("type", "rec").put("address", address).put("body", message.body());
  3. if (message.replyAddress() != null) {
  4. envelope.put("replyAddress", message.replyAddress());
  5. }
  6. if (message.headers() != null && !message.headers().isEmpty()) {
  7. JsonObject headersCopy = new JsonObject();
  8. for (String name : message.headers().names()) {
  9. List<String> values = message.headers().getAll(name);
  10. if (values.size() == 1) {
  11. headersCopy.put(name, values.get(0));
  12. } else {
  13. headersCopy.put(name, values);
  14. }
  15. }
  16. envelope.put("headers", headersCopy);
  17. }
  18. checkCallHook(() -> new BridgeEventImpl(BridgeEventType.RECEIVE, envelope, sock),
  19. () -> sock.write(buffer(envelope.encode())),
  20. () -> log.debug("outbound message rejected by bridge event handler"));
  21. }

代码示例来源:origin: io.vertx/vertx-core

  1. synchronized void writeMessage(ClusteredMessage message) {
  2. if (connected) {
  3. Buffer data = message.encodeToWire();
  4. if (metrics != null) {
  5. metrics.messageWritten(message.address(), data.length());
  6. }
  7. socket.write(data);
  8. } else {
  9. if (pending == null) {
  10. if (log.isDebugEnabled()) {
  11. log.debug("Not connected to server " + serverID + " - starting queuing");
  12. }
  13. pending = new ArrayDeque<>();
  14. }
  15. pending.add(message);
  16. }
  17. }

代码示例来源:origin: io.vertx/vertx-core

  1. void close() {
  2. if (timeoutID != -1) {
  3. vertx.cancelTimer(timeoutID);
  4. }
  5. if (pingTimeoutID != -1) {
  6. vertx.cancelTimer(pingTimeoutID);
  7. }
  8. try {
  9. client.close();
  10. } catch (Exception ignore) {
  11. }
  12. // The holder can be null or different if the target server is restarted with same serverid
  13. // before the cleanup for the previous one has been processed
  14. if (eventBus.connections().remove(serverID, this)) {
  15. if (log.isDebugEnabled()) {
  16. log.debug("Cluster connection closed for server " + serverID);
  17. }
  18. }
  19. }

代码示例来源:origin: io.vertx/vertx-core

  1. private void handshakeComplete(ChannelHandlerContext ctx, FullHttpResponse response) {
  2. handshaking = false;
  3. ChannelHandler handler = ctx.pipeline().get(HttpContentDecompressor.class);
  4. if (handler != null) {
  5. // remove decompressor as its not needed anymore once connection was upgraded to websockets
  6. ctx.pipeline().remove(handler);
  7. }
  8. WebSocketImpl webSocket = new WebSocketImpl(vertx, Http1xClientConnection.this, supportsContinuation,
  9. options.getMaxWebsocketFrameSize(),
  10. options.getMaxWebsocketMessageSize());
  11. ws = webSocket;
  12. handshaker.finishHandshake(chctx.channel(), response);
  13. ws.subProtocol(handshaker.actualSubprotocol());
  14. context.executeFromIO(v -> {
  15. log.debug("WebSocket handshake complete");
  16. if (metrics != null ) {
  17. webSocket.setMetric(metrics.connected(endpointMetric, metric(), webSocket));
  18. }
  19. webSocket.registerHandler(vertx.eventBus());
  20. wsConnect.handle(webSocket);
  21. });
  22. }
  23. }

代码示例来源:origin: vert-x3/vertx-web

  1. @Test
  2. public void testCombineTextFrameSockJs() throws InterruptedException {
  3. String serverPath = "/text-combine-sockjs";
  4. setupSockJsServer(serverPath, this::echoRequest);
  5. List<Buffer> receivedMessages = new ArrayList<>();
  6. WebSocket openedWebSocket = setupSockJsClient(serverPath, receivedMessages);
  7. Buffer largeMessage = Buffer.buffer("[\"" + TestUtils.randomAlphaString(30) + "\"]");
  8. WebSocketFrame frame1 = new WebSocketFrameImpl(FrameType.TEXT, largeMessage.slice(0, 10).getByteBuf(), false);
  9. WebSocketFrame frame2 = WebSocketFrame.continuationFrame(largeMessage.slice(10, 20), false);
  10. WebSocketFrame frame3 = WebSocketFrame.continuationFrame(largeMessage.slice(20, largeMessage.length()), true);
  11. log.debug("Client sending " + frame1.textData());
  12. openedWebSocket.writeFrame(frame1);
  13. log.debug("Client sending " + frame2.textData());
  14. openedWebSocket.writeFrame(frame2);
  15. log.debug("Client sending " + frame3.textData());
  16. openedWebSocket.writeFrame(frame3);
  17. await(5, TimeUnit.SECONDS);
  18. assertEquals("Client should have received 2 messages: the reply and the close.", 2, receivedMessages.size());
  19. Buffer expectedReply = Buffer.buffer("a" + largeMessage.toString());
  20. assertEquals("Client reply should have matched request", expectedReply, receivedMessages.get(0));
  21. assertEquals("Final message should have been a close", SOCKJS_CLOSE_REPLY, receivedMessages.get(1));
  22. }

相关文章