org.robolectric.util.Logger.loggingEnabled()方法的使用及代码示例

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

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

Logger.loggingEnabled介绍

暂无

代码示例

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

  1. /**
  2. * Log an info message.
  3. *
  4. * @param message Message text.
  5. * @param args Message arguments.
  6. */
  7. public static void info(String message, Object... args) {
  8. if (loggingEnabled()) {
  9. System.out.print("INFO: ");
  10. System.out.println(String.format(message, args));
  11. }
  12. }

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

  1. public static void strict(String message, Throwable e) {
  2. if (loggingEnabled()) {
  3. System.out.print("WARNING: ");
  4. System.out.println(message);
  5. e.printStackTrace();
  6. }
  7. }

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

  1. public static void strict(String message, Object... args) {
  2. if (loggingEnabled()) {
  3. System.out.print("WARNING: ");
  4. System.out.println(String.format(message, args));
  5. }
  6. }

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

  1. /**
  2. * Log a warning message.
  3. *
  4. * @param message Message text.
  5. * @param args Message arguments.
  6. */
  7. public static void warn(String message, Object... args) {
  8. if (loggingEnabled()) {
  9. System.out.print("WARN: ");
  10. System.out.println(String.format(message, args));
  11. }
  12. }

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

  1. /**
  2. * Log a debug message.
  3. *
  4. * @param message Message text.
  5. * @param args Message arguments.
  6. */
  7. public static void debug(String message, Object... args) {
  8. if (loggingEnabled()) {
  9. System.out.print("DEBUG: ");
  10. System.out.println(String.format(message, args));
  11. }
  12. }

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

  1. public TypedResource pick(ResName resName, ResTable_config toMatch) {
  2. List<TypedResource> values = map.get(resName);
  3. if (values == null || values.size() == 0) return null;
  4. TypedResource bestMatchSoFar = null;
  5. for (TypedResource candidate : values) {
  6. ResTable_config candidateConfig = candidate.getConfig();
  7. if (candidateConfig.match(toMatch)) {
  8. if (bestMatchSoFar == null || candidateConfig.isBetterThan(bestMatchSoFar.getConfig(), toMatch)) {
  9. bestMatchSoFar = candidate;
  10. }
  11. }
  12. }
  13. if (Logger.loggingEnabled()) {
  14. Logger.debug("Picked '%s' for %s for qualifiers '%s' (%d candidates)",
  15. bestMatchSoFar == null ? "<none>" : bestMatchSoFar.getXmlContext().getQualifiers().toString(),
  16. resName.getFullyQualifiedName(),
  17. toMatch,
  18. values.size());
  19. }
  20. return bestMatchSoFar;
  21. }

代码示例来源:origin: org.robolectric/utils

  1. /**
  2. * Log an info message.
  3. *
  4. * @param message Message text.
  5. * @param args Message arguments.
  6. */
  7. public static void info(String message, Object... args) {
  8. if (loggingEnabled()) {
  9. System.out.print("INFO: ");
  10. System.out.println(String.format(message, args));
  11. }
  12. }

代码示例来源:origin: org.robolectric/utils

  1. public static void strict(String message, Throwable e) {
  2. if (loggingEnabled()) {
  3. System.out.print("WARNING: ");
  4. System.out.println(message);
  5. e.printStackTrace();
  6. }
  7. }

代码示例来源:origin: org.robolectric/robolectric-utils

  1. /**
  2. * Log an info message.
  3. *
  4. * @param message Message text.
  5. * @param args Message arguments.
  6. */
  7. public static void info(String message, Object... args) {
  8. if (loggingEnabled()) {
  9. System.out.print("INFO: ");
  10. System.out.println(String.format(message, args));
  11. }
  12. }

代码示例来源:origin: org.robolectric/robolectric-utils

  1. public static void strict(String message, Object... args) {
  2. if (loggingEnabled()) {
  3. System.out.print("WARNING: ");
  4. System.out.println(String.format(message, args));
  5. }
  6. }

代码示例来源:origin: org.robolectric/utils

  1. /**
  2. * Log a warning message.
  3. *
  4. * @param message Message text.
  5. * @param args Message arguments.
  6. */
  7. public static void warn(String message, Object... args) {
  8. if (loggingEnabled()) {
  9. System.out.print("WARN: ");
  10. System.out.println(String.format(message, args));
  11. }
  12. }

代码示例来源:origin: org.robolectric/robolectric-utils

  1. public static void strict(String message, Throwable e) {
  2. if (loggingEnabled()) {
  3. System.out.print("WARNING: ");
  4. System.out.println(message);
  5. e.printStackTrace();
  6. }
  7. }

代码示例来源:origin: org.robolectric/robolectric-utils

  1. /**
  2. * Log a debug message.
  3. *
  4. * @param message Message text.
  5. * @param args Message arguments.
  6. */
  7. public static void debug(String message, Object... args) {
  8. if (loggingEnabled()) {
  9. System.out.print("DEBUG: ");
  10. System.out.println(String.format(message, args));
  11. }
  12. }

代码示例来源:origin: org.robolectric/utils

  1. public static void strict(String message, Object... args) {
  2. if (loggingEnabled()) {
  3. System.out.print("WARNING: ");
  4. System.out.println(String.format(message, args));
  5. }
  6. }

代码示例来源:origin: org.robolectric/utils

  1. /**
  2. * Log a debug message.
  3. *
  4. * @param message Message text.
  5. * @param args Message arguments.
  6. */
  7. public static void debug(String message, Object... args) {
  8. if (loggingEnabled()) {
  9. System.out.print("DEBUG: ");
  10. System.out.println(String.format(message, args));
  11. }
  12. }

代码示例来源:origin: org.robolectric/resources

  1. public TypedResource pick(ResName resName, ResTable_config toMatch) {
  2. List<TypedResource> values = map.get(resName);
  3. if (values == null || values.size() == 0) return null;
  4. TypedResource bestMatchSoFar = null;
  5. for (TypedResource candidate : values) {
  6. ResTable_config candidateConfig = candidate.getConfig();
  7. if (candidateConfig.match(toMatch)) {
  8. if (bestMatchSoFar == null || candidateConfig.isBetterThan(bestMatchSoFar.getConfig(), toMatch)) {
  9. bestMatchSoFar = candidate;
  10. }
  11. }
  12. }
  13. if (Logger.loggingEnabled()) {
  14. Logger.debug("Picked '%s' for %s for qualifiers '%s' (%d candidates)",
  15. bestMatchSoFar == null ? "<none>" : bestMatchSoFar.getXmlContext().getQualifiers().toString(),
  16. resName.getFullyQualifiedName(),
  17. toMatch,
  18. values.size());
  19. }
  20. return bestMatchSoFar;
  21. }

相关文章