org.ocpsoft.logging.Logger.getLogger()方法的使用及代码示例

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

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

Logger.getLogger介绍

[英]Create a Logger instance for a specific class
[中]为特定类创建记录器实例

代码示例

代码示例来源:origin: org.ocpsoft.logging/logging-api

/**
* Create a {@link Logger} instance for a specific class
* 
* @param clazz The class to create the log for
* @return The {@link Logger} instance
*/
public static Logger getLogger(final Class<?> clazz)
{
 return getLogger(clazz.getName());
}

代码示例来源:origin: ocpsoft/rewrite

/**
* Create a {@link Logger} instance for a specific class
* 
* @param clazz The class to create the log for
* @return The {@link Logger} instance
*/
public static Logger getLogger(final Class<?> clazz)
{
 return getLogger(clazz.getName());
}

代码示例来源:origin: org.jboss.windup.config/windup-config-api

public static Log message(Class<?> cls, Level level, String message)
{
  return new Log(Logger.getLogger(cls), level, message);
}

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

public static Log message(Class<?> cls, Level level, String message)
{
  return new Log(Logger.getLogger(cls), level, message);
}

代码示例来源:origin: org.jboss.windup.web.addons/windup-web-support-impl

private static List<String> findPaths(Path path, boolean relativeOnly)
  {
    List<String> results = new ArrayList<>();
    results.add(path.normalize().toAbsolutePath().toString());

    if (Files.isDirectory(path))
    {
      try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(path))
      {
        for (Path child : directoryStream)
        {
          results.addAll(findPaths(child, relativeOnly));
        }
      }
      catch (IOException e)
      {
        Logger.getLogger(PackageDiscoveryServiceImpl.class).warn("Could not read file: " + path + " due to: " + e.getMessage());
      }
    }
    else if (Files.isRegularFile(path) && ZipUtil.endsWithZipExtension(path.toString()))
    {
      results.addAll(ZipUtil.scanZipFile(path, relativeOnly));
    }

    return results;
  }
}

代码示例来源:origin: org.jboss.windup.config/windup-config-api

private Log(Logger log, Level level, String message)
{
  Class<?> caller = findClassCaller();
  if (caller == null)
    caller = Log.class;
  log = Logger.getLogger(caller);
  if (level == null)
    level = Level.INFO;
  if (message == null)
    message = "(null)";
  this.log = log;
  this.level = level;
  this.messageBuilder = new RegexParameterizedPatternBuilder(message);
}

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

private Log(Logger log, Level level, String message)
{
  Class<?> caller = findClassCaller();
  if (caller == null)
    caller = Log.class;
  log = Logger.getLogger(caller);
  if (level == null)
    level = Level.INFO;
  if (message == null)
    message = "(null)";
  this.log = log;
  this.level = level;
  this.messageBuilder = new RegexParameterizedPatternBuilder(message);
}

代码示例来源:origin: ocpsoft/rewrite

public class AnnotationConfigProvider extends HttpConfigurationProvider
  private final Logger log = Logger.getLogger(AnnotationConfigProvider.class);

代码示例来源:origin: ocpsoft/rewrite

public class AnnotationConfigProvider extends HttpConfigurationProvider
  private final Logger log = Logger.getLogger(AnnotationConfigProvider.class);

相关文章