java.util.logging.LogManager.getOrCreate()方法的使用及代码示例

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

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

LogManager.getOrCreate介绍

[英]Returns a named logger associated with the supplied resource bundle.
[中]返回与提供的资源包关联的命名记录器。

代码示例

代码示例来源:origin: robovm/robovm

/**
 * Gets a named logger. The returned logger may already exist or may be
 * newly created. In the latter case, its level will be set to the
 * configured level according to the {@code LogManager}'s properties.
 *
 * @param name
 *            the name of the logger to get, cannot be {@code null}.
 * @return a named logger.
 * @throws MissingResourceException
 *             If the specified resource bundle can not be loaded.
 */
public static Logger getLogger(String name) {
  return LogManager.getLogManager().getOrCreate(name, null);
}

代码示例来源:origin: robovm/robovm

/**
 * Gets a named logger associated with the supplied resource bundle. The
 * resource bundle will be used to localize logging messages.
 *
 * @param name
 *            the name of the logger to get, cannot be {@code null}.
 * @param resourceBundleName
 *            the name of the resource bundle, may be {@code null}.
 * @throws IllegalArgumentException
 *             if the logger identified by {@code name} is associated with a
 *             resource bundle and its name is not equal to
 *             {@code resourceBundleName}.
 * @throws MissingResourceException
 *             if the name of the resource bundle cannot be found.
 * @return a named logger.
 */
public static Logger getLogger(String name, String resourceBundleName) {
  Logger result = LogManager.getLogManager()
      .getOrCreate(name, resourceBundleName);
  result.initResourceBundle(resourceBundleName);
  return result;
}

代码示例来源:origin: MobiVM/robovm

/**
 * Gets a named logger. The returned logger may already exist or may be
 * newly created. In the latter case, its level will be set to the
 * configured level according to the {@code LogManager}'s properties.
 *
 * @param name
 *            the name of the logger to get, cannot be {@code null}.
 * @return a named logger.
 * @throws MissingResourceException
 *             If the specified resource bundle can not be loaded.
 */
public static Logger getLogger(String name) {
  return LogManager.getLogManager().getOrCreate(name, null);
}

代码示例来源:origin: com.jtransc/jtransc-rt

public static Logger getLogger(String name) {
  return LogManager.getLogManager().getOrCreate(name, null);
}

代码示例来源:origin: ibinti/bugvm

/**
 * Gets a named logger. The returned logger may already exist or may be
 * newly created. In the latter case, its level will be set to the
 * configured level according to the {@code LogManager}'s properties.
 *
 * @param name
 *            the name of the logger to get, cannot be {@code null}.
 * @return a named logger.
 * @throws MissingResourceException
 *             If the specified resource bundle can not be loaded.
 */
public static Logger getLogger(String name) {
  return LogManager.getLogManager().getOrCreate(name, null);
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Gets a named logger. The returned logger may already exist or may be
 * newly created. In the latter case, its level will be set to the
 * configured level according to the {@code LogManager}'s properties.
 *
 * @param name
 *            the name of the logger to get, cannot be {@code null}.
 * @return a named logger.
 * @throws MissingResourceException
 *             If the specified resource bundle can not be loaded.
 */
public static Logger getLogger(String name) {
  return LogManager.getLogManager().getOrCreate(name, null);
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Gets a named logger. The returned logger may already exist or may be
 * newly created. In the latter case, its level will be set to the
 * configured level according to the {@code LogManager}'s properties.
 *
 * @param name
 *            the name of the logger to get, cannot be {@code null}.
 * @return a named logger.
 * @throws MissingResourceException
 *             If the specified resource bundle can not be loaded.
 */
public static Logger getLogger(String name) {
  return LogManager.getLogManager().getOrCreate(name, null);
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Gets a named logger. The returned logger may already exist or may be
 * newly created. In the latter case, its level will be set to the
 * configured level according to the {@code LogManager}'s properties.
 *
 * @param name
 *            the name of the logger to get, cannot be {@code null}.
 * @return a named logger.
 * @throws MissingResourceException
 *             If the specified resource bundle can not be loaded.
 */
public static Logger getLogger(String name) {
  return LogManager.getLogManager().getOrCreate(name, null);
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Gets a named logger. The returned logger may already exist or may be
 * newly created. In the latter case, its level will be set to the
 * configured level according to the {@code LogManager}'s properties.
 *
 * @param name
 *            the name of the logger to get, cannot be {@code null}.
 * @return a named logger.
 * @throws MissingResourceException
 *             If the specified resource bundle can not be loaded.
 */
public static Logger getLogger(String name) {
  return LogManager.getLogManager().getOrCreate(name, null);
}

代码示例来源:origin: com.jtransc/jtransc-rt

public static Logger getLogger(String name, String resourceBundleName) {
  Logger result = LogManager.getLogManager().getOrCreate(name, resourceBundleName);
  result.initResourceBundle(resourceBundleName);
  return result;
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Gets a named logger associated with the supplied resource bundle. The
 * resource bundle will be used to localize logging messages.
 *
 * @param name
 *            the name of the logger to get, cannot be {@code null}.
 * @param resourceBundleName
 *            the name of the resource bundle, may be {@code null}.
 * @throws IllegalArgumentException
 *             if the logger identified by {@code name} is associated with a
 *             resource bundle and its name is not equal to
 *             {@code resourceBundleName}.
 * @throws MissingResourceException
 *             if the name of the resource bundle cannot be found.
 * @return a named logger.
 */
public static Logger getLogger(String name, String resourceBundleName) {
  Logger result = LogManager.getLogManager()
      .getOrCreate(name, resourceBundleName);
  result.initResourceBundle(resourceBundleName);
  return result;
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Gets a named logger associated with the supplied resource bundle. The
 * resource bundle will be used to localize logging messages.
 *
 * @param name
 *            the name of the logger to get, cannot be {@code null}.
 * @param resourceBundleName
 *            the name of the resource bundle, may be {@code null}.
 * @throws IllegalArgumentException
 *             if the logger identified by {@code name} is associated with a
 *             resource bundle and its name is not equal to
 *             {@code resourceBundleName}.
 * @throws MissingResourceException
 *             if the name of the resource bundle cannot be found.
 * @return a named logger.
 */
public static Logger getLogger(String name, String resourceBundleName) {
  Logger result = LogManager.getLogManager()
      .getOrCreate(name, resourceBundleName);
  result.initResourceBundle(resourceBundleName);
  return result;
}

代码示例来源:origin: MobiVM/robovm

/**
 * Gets a named logger associated with the supplied resource bundle. The
 * resource bundle will be used to localize logging messages.
 *
 * @param name
 *            the name of the logger to get, cannot be {@code null}.
 * @param resourceBundleName
 *            the name of the resource bundle, may be {@code null}.
 * @throws IllegalArgumentException
 *             if the logger identified by {@code name} is associated with a
 *             resource bundle and its name is not equal to
 *             {@code resourceBundleName}.
 * @throws MissingResourceException
 *             if the name of the resource bundle cannot be found.
 * @return a named logger.
 */
public static Logger getLogger(String name, String resourceBundleName) {
  Logger result = LogManager.getLogManager()
      .getOrCreate(name, resourceBundleName);
  result.initResourceBundle(resourceBundleName);
  return result;
}

代码示例来源:origin: ibinti/bugvm

/**
 * Gets a named logger associated with the supplied resource bundle. The
 * resource bundle will be used to localize logging messages.
 *
 * @param name
 *            the name of the logger to get, cannot be {@code null}.
 * @param resourceBundleName
 *            the name of the resource bundle, may be {@code null}.
 * @throws IllegalArgumentException
 *             if the logger identified by {@code name} is associated with a
 *             resource bundle and its name is not equal to
 *             {@code resourceBundleName}.
 * @throws MissingResourceException
 *             if the name of the resource bundle cannot be found.
 * @return a named logger.
 */
public static Logger getLogger(String name, String resourceBundleName) {
  Logger result = LogManager.getLogManager()
      .getOrCreate(name, resourceBundleName);
  result.initResourceBundle(resourceBundleName);
  return result;
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Gets a named logger associated with the supplied resource bundle. The
 * resource bundle will be used to localize logging messages.
 *
 * @param name
 *            the name of the logger to get, cannot be {@code null}.
 * @param resourceBundleName
 *            the name of the resource bundle, may be {@code null}.
 * @throws IllegalArgumentException
 *             if the logger identified by {@code name} is associated with a
 *             resource bundle and its name is not equal to
 *             {@code resourceBundleName}.
 * @throws MissingResourceException
 *             if the name of the resource bundle cannot be found.
 * @return a named logger.
 */
public static Logger getLogger(String name, String resourceBundleName) {
  Logger result = LogManager.getLogManager()
      .getOrCreate(name, resourceBundleName);
  result.initResourceBundle(resourceBundleName);
  return result;
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Gets a named logger associated with the supplied resource bundle. The
 * resource bundle will be used to localize logging messages.
 *
 * @param name
 *            the name of the logger to get, cannot be {@code null}.
 * @param resourceBundleName
 *            the name of the resource bundle, may be {@code null}.
 * @throws IllegalArgumentException
 *             if the logger identified by {@code name} is associated with a
 *             resource bundle and its name is not equal to
 *             {@code resourceBundleName}.
 * @throws MissingResourceException
 *             if the name of the resource bundle cannot be found.
 * @return a named logger.
 */
public static Logger getLogger(String name, String resourceBundleName) {
  Logger result = LogManager.getLogManager()
      .getOrCreate(name, resourceBundleName);
  result.initResourceBundle(resourceBundleName);
  return result;
}

相关文章