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

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

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

Logger.info介绍

[英]Log a message at the INFO level.
[中]在信息级别记录消息。

代码示例

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

  1. private static void logSuppressed(Throwable[] suppressed) {
  2. for(Throwable s: suppressed) {
  3. log.info("SUPPRESSED exception(meaning it's secondary after a main failure", s);
  4. }
  5. }

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

  1. protected void runStartupHooks(Injector injector) {
  2. log.info("Running startup hooks for server");
  3. Key<Set<Startable>> key = Key.get(new TypeLiteral<Set<Startable>>(){});
  4. Set<Startable> startupHooks = injector.getInstance(key);
  5. for(Startable s : startupHooks) {
  6. runStartupHook(s);
  7. }
  8. log.info("Ran all startup hooks");
  9. }

代码示例来源:origin: org.webpieces/plugin-hibernate

  1. @Singleton
  2. @Provides
  3. public EntityManagerFactory providesSessionFactory() throws IOException {
  4. log.info("Loading Hibernate. ENTITY classloader="+entityClassLoader+" hibernate classloader="+this.getClass().getClassLoader());
  5. Map<String, Object> properties = createClassLoaderProperty();
  6. EntityManagerFactory factory = Persistence.createEntityManagerFactory(persistenceUnit, properties );
  7. log.info("Done loading Hibernate");
  8. return factory;
  9. }

代码示例来源:origin: org.webpieces/hibernate-plugin

  1. @Singleton
  2. @Provides
  3. public EntityManagerFactory providesSessionFactory() throws IOException {
  4. log.info("Loading Hibernate. ENTITY classloader="+entityClassLoader+" hibernate classloader="+this.getClass().getClassLoader());
  5. Map<String, Object> properties = createClassLoaderProperty();
  6. EntityManagerFactory factory = Persistence.createEntityManagerFactory(persistenceUnit, properties );
  7. log.info("Done loading Hibernate");
  8. return factory;
  9. }

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

  1. @Override
  2. public void failure(Channel channel, ByteBuffer data, Exception e) {
  3. log.info("Failure on channel="+channel, e);
  4. channel.close();
  5. }

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

  1. @Override
  2. public void start() {
  3. log.info("starting server");
  4. InetSocketAddress addr = new InetSocketAddress(8080);
  5. FrontendConfig config = new FrontendConfig("httpProxy", addr);
  6. config.asyncServerConfig.functionToConfigureBeforeBind = s -> s.socket().setReuseAddress(true);
  7. httpServer = serverMgr.createHttpServer(config, serverListener);
  8. // InetSocketAddress sslAddr = new InetSocketAddress(8443);
  9. // httpsServer = serverMgr.createTcpServer("httpsProxy", sslAddr, sslServerListener);
  10. log.info("now listening for incoming connections");
  11. }

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

  1. private void sendBadResponse(Channel channel, HttpException exc) {
  2. try {
  3. processor.sendServerException(channel, exc);
  4. } catch(Throwable e) {
  5. log.info("Could not send response to client", e);
  6. }
  7. }

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

  1. @Override
  2. public void release() {
  3. log.info("key:"+key+" Exit async sync block");
  4. permitQueue.releasePermit();
  5. }
  6. }

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

  1. @Override
  2. public CompletableFuture<Void> sendEncryptedHandshakeData(ByteBuffer engineToSocketData) {
  3. try {
  4. return realChannel.write(engineToSocketData);
  5. } catch(NioClosedChannelException e) {
  6. log.info("Remote end closed before handshake was finished. (nothing we can do about that)");
  7. return CompletableFuture.completedFuture(null);
  8. }
  9. }

代码示例来源:origin: org.webpieces/hibernate-plugin

  1. private Action commitOrRollback(EntityManager em, Action action, Throwable t) {
  2. EntityTransaction tx = em.getTransaction();
  3. if(t != null) {
  4. log.info("Transaction being rolled back");
  5. rollbackTx(t, tx);
  6. closeEm(t, em);
  7. throw new RuntimeException(t);
  8. }
  9. log.info("Transaction being committed");
  10. commit(tx, em);
  11. return action;
  12. }

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

  1. public void processResponse(ResponseSender responseSender, HttpRequest req, HttpResponse resp, RequestId requestId, ResponseId incomingResponseId, boolean isComplete) {
  2. log.info("received response(responseSender="+responseSender+"). type="+resp.getClass().getSimpleName()+" complete="+isComplete+" resp=\n"+resp);
  3. responseSender.sendResponse(resp, req, requestId, isComplete)
  4. .thenAccept(outgoingResponseId -> {
  5. wroteBytes(responseSender);
  6. incomingResponseToOutgoingResponseMap.put(incomingResponseId, outgoingResponseId);
  7. })
  8. .exceptionally(e -> failedWrite(responseSender, e));
  9. }

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

  1. @Override
  2. public void runImpl() {
  3. socketToTimeout.remove(httpSocket);
  4. log.info("timing out a client that did not send a request in time="+config.maxConnectToRequestTimeoutMs+"ms so we are closing that client's socket. httpSocket="+ httpSocket);
  5. HttpClientException exc = new HttpClientException("timing out a client who did not send a request in time", KnownStatusCode.HTTP_408_REQUEST_TIMEOUT);
  6. incomingError(exc, httpSocket);
  7. }
  8. }

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

  1. @Override
  2. public void start() {
  3. log.info("Starting DEVELOPMENT server with CompilingClassLoader and HotSwap");
  4. loadOrReload(injector -> runStartupHooks(injector));
  5. started = true;
  6. }

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

  1. @Override
  2. public void onRemoval(RemovalNotification<SocketAddress, HttpClientSocket> notification) {
  3. log.info("closing socket="+notification.getKey()+". cache removal cause="+notification.getCause());
  4. HttpClientSocket socket = notification.getValue();
  5. socket.closeSocket();
  6. }
  7. }

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

  1. private void addStaticClasspathFile(String urlPath, String fileSystemPath) {
  2. if(!fileSystemPath.startsWith("/"))
  3. throw new IllegalArgumentException("Classpath resources must start with a / and be absolute on the classpath");
  4. boolean isDirectory = fileSystemPath.endsWith("/");
  5. VirtualFile file = new VirtualFileClasspath(fileSystemPath, getClass(), isDirectory);
  6. StaticRoute route = new StaticRoute(new UrlPath(routerInfo, urlPath), file, true, holder.getCachedCompressedDirectory());
  7. staticRoutes.add(route);
  8. log.info("scope:'"+routerInfo+"' adding static route="+route.getFullPath()+" fileSystemPath="+route.getFileSystemPath());
  9. RouteMeta meta = new RouteMeta(route, holder.getInjector(), currentPackage.get(), holder.getUrlEncoding());
  10. allRouting.addStaticRoute(meta);
  11. }

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

  1. @Override
  2. public void connectionOpened(TCPChannel channel, boolean isReadyForWrites) {
  3. log.info(channel+" socket opened");
  4. //when a channel is SSL, we can tell right away IF ALPN is installed
  5. //boolean isHttp2 = channel.getAlpnDetails().isHttp2();
  6. FrontendSocketImpl socket = new FrontendSocketImpl(channel, ProtocolType.UNKNOWN, svrSocketInfo);
  7. channel.getSession().put(FRONTEND_SOCKET, socket);
  8. http1_1Handler.socketOpened(socket, isReadyForWrites);
  9. }

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

  1. private void setNotFoundRoute(Route r) {
  2. if(!"".equals(this.routerInfo.getPath()))
  3. throw new UnsupportedOperationException("setNotFoundRoute can only be called on the root Router, not a scoped router");
  4. log.info("scope:'"+routerInfo+"' adding PAGE_NOT_FOUND route="+r.getFullPath()+" method="+r.getControllerMethodString());
  5. RouteMeta meta = new RouteMeta(r, holder.getInjector(), currentPackage.get(), holder.getUrlEncoding());
  6. holder.getFinder().loadControllerIntoMetaObject(meta, true);
  7. domainRoutes.setPageNotFoundRoute(meta);
  8. }

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

  1. private void addStaticLocalFile(String urlPath, String fileSystemPath) {
  2. if(fileSystemPath.startsWith("/"))
  3. throw new IllegalArgumentException("Absolute file system path is not supported as it is not portable across OS when done wrong. Override the modules working directory instead");
  4. File workingDir = holder.getConfig().getWorkingDirectory();
  5. VirtualFile file = VirtualFileFactory.newFile(workingDir, fileSystemPath);
  6. StaticRoute route = new StaticRoute(new UrlPath(routerInfo, urlPath), file, false, holder.getCachedCompressedDirectory());
  7. staticRoutes.add(route);
  8. log.info("scope:'"+routerInfo+"' adding static route="+route.getFullPath()+" fileSystemPath="+route.getFileSystemPath());
  9. RouteMeta meta = new RouteMeta(route, holder.getInjector(), currentPackage.get(), holder.getUrlEncoding());
  10. allRouting.addStaticRoute(meta);
  11. }

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

  1. @Override
  2. public void incomingError(HttpException exc, HttpSocket httpSocket) {
  3. listener.incomingError(exc, httpSocket);
  4. //safety measure preventing leak on quick connect/close clients
  5. releaseTimeout(httpSocket);
  6. log.info("closing socket="+httpSocket+" due to response code="+exc.getStatusCode());
  7. ((HttpServerSocket) httpSocket).getResponseSender().close();
  8. listener.channelClosed(httpSocket, false);
  9. }

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

  1. void openedConnection(HttpServerSocket httpServerSocket, boolean isReadyForWrites) {
  2. log.info("opened connection from " + httpServerSocket + " isReadyForWrites=" + isReadyForWrites);
  3. if(!httpServerSocket.getUnderlyingChannel().isSslChannel()) {
  4. scheduleTimeout(httpServerSocket);
  5. clientOpenChannel(httpServerSocket);
  6. } else if(isReadyForWrites) {
  7. //if ready for writes, the tcpChannel is encrypted and fully open
  8. clientOpenChannel(httpServerSocket);
  9. } else { //if not ready for writes, the socket is open but encryption handshake is not been done yet
  10. scheduleTimeout(httpServerSocket);
  11. }
  12. }

相关文章