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

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

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

Logger.loggingEnabled介绍

暂无

代码示例

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

/**
 * Log an info message.
 *
 * @param message Message text.
 * @param args    Message arguments.
 */
public static void info(String message, Object... args) {
 if (loggingEnabled()) {
  System.out.print("INFO: ");
  System.out.println(String.format(message, args));
 }
}

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

public static void strict(String message, Throwable e) {
 if (loggingEnabled()) {
  System.out.print("WARNING: ");
  System.out.println(message);
  e.printStackTrace();
 }
}

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

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

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

/**
 * Log a warning message.
 *
 * @param message Message text.
 * @param args    Message arguments.
 */
public static void warn(String message, Object... args) {
 if (loggingEnabled()) {
  System.out.print("WARN: ");
  System.out.println(String.format(message, args));
 }
}

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

/**
 * Log a debug message.
 *
 * @param message Message text.
 * @param args    Message arguments.
 */
public static void debug(String message, Object... args) {
 if (loggingEnabled()) {
  System.out.print("DEBUG: ");
  System.out.println(String.format(message, args));
 }
}

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

public TypedResource pick(ResName resName, ResTable_config toMatch) {
 List<TypedResource> values = map.get(resName);
 if (values == null || values.size() == 0) return null;
 TypedResource bestMatchSoFar = null;
 for (TypedResource candidate : values) {
  ResTable_config candidateConfig = candidate.getConfig();
  if (candidateConfig.match(toMatch)) {
   if (bestMatchSoFar == null || candidateConfig.isBetterThan(bestMatchSoFar.getConfig(), toMatch)) {
    bestMatchSoFar = candidate;
   }
  }
 }
 if (Logger.loggingEnabled()) {
  Logger.debug("Picked '%s' for %s for qualifiers '%s' (%d candidates)",
    bestMatchSoFar == null ? "<none>" : bestMatchSoFar.getXmlContext().getQualifiers().toString(),
    resName.getFullyQualifiedName(),
    toMatch,
    values.size());
 }
 return bestMatchSoFar;
}

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

/**
 * Log an info message.
 *
 * @param message Message text.
 * @param args    Message arguments.
 */
public static void info(String message, Object... args) {
 if (loggingEnabled()) {
  System.out.print("INFO: ");
  System.out.println(String.format(message, args));
 }
}

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

public static void strict(String message, Throwable e) {
 if (loggingEnabled()) {
  System.out.print("WARNING: ");
  System.out.println(message);
  e.printStackTrace();
 }
}

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

/**
 * Log an info message.
 *
 * @param message Message text.
 * @param args    Message arguments.
 */
public static void info(String message, Object... args) {
 if (loggingEnabled()) {
  System.out.print("INFO: ");
  System.out.println(String.format(message, args));
 }
}

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

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

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

/**
 * Log a warning message.
 *
 * @param message Message text.
 * @param args    Message arguments.
 */
public static void warn(String message, Object... args) {
 if (loggingEnabled()) {
  System.out.print("WARN: ");
  System.out.println(String.format(message, args));
 }
}

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

public static void strict(String message, Throwable e) {
 if (loggingEnabled()) {
  System.out.print("WARNING: ");
  System.out.println(message);
  e.printStackTrace();
 }
}

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

/**
 * Log a debug message.
 *
 * @param message Message text.
 * @param args    Message arguments.
 */
public static void debug(String message, Object... args) {
 if (loggingEnabled()) {
  System.out.print("DEBUG: ");
  System.out.println(String.format(message, args));
 }
}

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

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

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

/**
 * Log a debug message.
 *
 * @param message Message text.
 * @param args    Message arguments.
 */
public static void debug(String message, Object... args) {
 if (loggingEnabled()) {
  System.out.print("DEBUG: ");
  System.out.println(String.format(message, args));
 }
}

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

public TypedResource pick(ResName resName, ResTable_config toMatch) {
 List<TypedResource> values = map.get(resName);
 if (values == null || values.size() == 0) return null;
 TypedResource bestMatchSoFar = null;
 for (TypedResource candidate : values) {
  ResTable_config candidateConfig = candidate.getConfig();
  if (candidateConfig.match(toMatch)) {
   if (bestMatchSoFar == null || candidateConfig.isBetterThan(bestMatchSoFar.getConfig(), toMatch)) {
    bestMatchSoFar = candidate;
   }
  }
 }
 if (Logger.loggingEnabled()) {
  Logger.debug("Picked '%s' for %s for qualifiers '%s' (%d candidates)",
    bestMatchSoFar == null ? "<none>" : bestMatchSoFar.getXmlContext().getQualifiers().toString(),
    resName.getFullyQualifiedName(),
    toMatch,
    values.size());
 }
 return bestMatchSoFar;
}

相关文章