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

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

本文整理了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

  1. /**
  2. * Create a {@link Logger} instance for a specific class
  3. *
  4. * @param clazz The class to create the log for
  5. * @return The {@link Logger} instance
  6. */
  7. public static Logger getLogger(final Class<?> clazz)
  8. {
  9. return getLogger(clazz.getName());
  10. }

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

  1. /**
  2. * Create a {@link Logger} instance for a specific class
  3. *
  4. * @param clazz The class to create the log for
  5. * @return The {@link Logger} instance
  6. */
  7. public static Logger getLogger(final Class<?> clazz)
  8. {
  9. return getLogger(clazz.getName());
  10. }

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

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

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

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

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

  1. private static List<String> findPaths(Path path, boolean relativeOnly)
  2. {
  3. List<String> results = new ArrayList<>();
  4. results.add(path.normalize().toAbsolutePath().toString());
  5. if (Files.isDirectory(path))
  6. {
  7. try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(path))
  8. {
  9. for (Path child : directoryStream)
  10. {
  11. results.addAll(findPaths(child, relativeOnly));
  12. }
  13. }
  14. catch (IOException e)
  15. {
  16. Logger.getLogger(PackageDiscoveryServiceImpl.class).warn("Could not read file: " + path + " due to: " + e.getMessage());
  17. }
  18. }
  19. else if (Files.isRegularFile(path) && ZipUtil.endsWithZipExtension(path.toString()))
  20. {
  21. results.addAll(ZipUtil.scanZipFile(path, relativeOnly));
  22. }
  23. return results;
  24. }
  25. }

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

  1. private Log(Logger log, Level level, String message)
  2. {
  3. Class<?> caller = findClassCaller();
  4. if (caller == null)
  5. caller = Log.class;
  6. log = Logger.getLogger(caller);
  7. if (level == null)
  8. level = Level.INFO;
  9. if (message == null)
  10. message = "(null)";
  11. this.log = log;
  12. this.level = level;
  13. this.messageBuilder = new RegexParameterizedPatternBuilder(message);
  14. }

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

  1. private Log(Logger log, Level level, String message)
  2. {
  3. Class<?> caller = findClassCaller();
  4. if (caller == null)
  5. caller = Log.class;
  6. log = Logger.getLogger(caller);
  7. if (level == null)
  8. level = Level.INFO;
  9. if (message == null)
  10. message = "(null)";
  11. this.log = log;
  12. this.level = level;
  13. this.messageBuilder = new RegexParameterizedPatternBuilder(message);
  14. }

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

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

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

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

相关文章