com.proofpoint.log.Logger.get()方法的使用及代码示例

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

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

Logger.get介绍

[英]Gets a logger named after a class' fully qualified name.
[中]获取以类的完全限定名命名的记录器。

代码示例

代码示例来源:origin: com.proofpoint.platform/log

/**
 * Gets a logger named after a class' fully qualified name.
 *
 * @param clazz the class
 * @return the named logger
 */
public static Logger get(Class<?> clazz)
{
  return get(clazz.getName());
}

代码示例来源:origin: com.proofpoint.galaxy/galaxy-cli

public void warn(WARNING_ID id, String message, Object... data)
{
  String msg;
  try {
    msg = String.format(message, data);
  }
  catch (IllegalFormatException e) {
    msg = message + " " + Arrays.toString(data);
  }
  Logger.get("jnr-posix").warn(msg);
}

代码示例来源:origin: com.proofpoint.platform/log

@SuppressWarnings("IOResourceOpenedButNotSafelyClosed")
private static void redirectStdStreams()
{
  try {
    System.setOut(new PrintStream(new LoggingOutputStream(Logger.get("stdout")), true, "UTF-8"));
    System.setErr(new PrintStream(new LoggingOutputStream(Logger.get("stderr")), true, "UTF-8"));
  }
  catch (UnsupportedEncodingException ignored) {
  }
}

代码示例来源:origin: com.proofpoint.platform/rack

Logger.get(Main.class).error(e);
System.err.flush();
System.out.flush();

代码示例来源:origin: com.proofpoint.platform/rack-experimental

public static void main(String[] args)
      throws Exception
  {
    Bootstrap app = new Bootstrap(
        new NodeModule(),
        new HttpServerModule(),
        new HttpEventModule(),
        new DiscoveryModule(),
        new JsonModule(),
        new MBeanModule(),
        new RackModule(),
        new JmxModule(),
        new JmxHttpRpcModule());

    try {
      Injector injector = app.initialize();
      injector.getInstance(Announcer.class).start();
    }
    catch (Exception e) {
      Logger.get(Main.class).error(e);
      System.err.flush();
      System.out.flush();
      System.exit(0);
    }
    catch (Throwable t) {
      System.exit(0);
    }
  }
}

代码示例来源:origin: com.proofpoint.platform/http-server

adminExternalUri = buildUri("http", nodeInfo.getExternalAddress(), adminUri.getPort());
Logger.get("Bootstrap").info("Admin service on %s", adminUri);

相关文章