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

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

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

Logger.warn介绍

[英]Log a warning message.
[中]记录一条警告消息。

代码示例

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

private static Implementation getImplementationAnnotation(Method method) {
 if (method == null) {
  return null;
 }
 Implementation implementation = method.getAnnotation(Implementation.class);
 if (implementation == null) {
  Logger.warn("No @Implementation annotation on " + method);
 }
 return implementation == null
   ? IMPLEMENTATION_DEFAULTS
   : implementation;
}

代码示例来源:origin: ACRA/acra

@Override
public int w(String tag, Throwable tr) {
  Logger.warn("", tr);
  return 0;
}

代码示例来源:origin: ACRA/acra

@Override
public int w(String tag, String msg) {
  Logger.warn(msg.replace("%","%%"));
  return 0;
}

代码示例来源:origin: ACRA/acra

@Override
public int w(String tag, String msg, Throwable tr) {
  Logger.warn(msg.replace("%","%%"), tr);
  return 0;
}

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

private void loadFile(Path dir) throws IOException {
 if (!Files.exists(dir)) {
  throw new RuntimeException("no such directory " + dir);
 }
 if (!Files.isDirectory(dir)) {
  return;
 }
 Qualifiers qualifiers;
 try {
  qualifiers = Qualifiers.fromParentDir(dir);
 } catch (IllegalArgumentException e) {
  Logger.warn(dir + ": " + e.getMessage());
  return;
 }
 for (Path file : Fs.listFiles(dir, path -> path.getFileName().toString().endsWith(".xml"))) {
  loadResourceXmlFile(new XmlContext(packageName, file, qualifiers));
 }
}

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

@Implementation
@HiddenApi
protected void removeSyncBarrier(int token) {
 // TODO(b/74402484): workaround scheduler corruption of message queue
 try {
  directlyOn(realQueue, MessageQueue.class, "removeSyncBarrier", from(int.class, token));
 } catch (IllegalStateException e) {
  Logger.warn("removeSyncBarrier failed! Could not find token %d", token);
 }
}

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

qualifiers = Qualifiers.fromParentDir(dir);
} catch (IllegalArgumentException e) {
 Logger.warn(dir + ": " + e.getMessage());
 return;

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

private void loadRawFiles(PackageResourceTable resourceTable, String resourceType, Path rawDir)
   throws IOException {
  Qualifiers qualifiers;
  try {
   qualifiers = Qualifiers.fromParentDir(rawDir);
  } catch (IllegalArgumentException e) {
   Logger.warn(rawDir + ": " + e.getMessage());
   return;
  }

  for (Path file : Fs.listFiles(rawDir)) {
   String fileBaseName = Fs.baseNameFor(file);
   resourceTable.addResource(
     resourceType,
     fileBaseName,
     new FileTypedResource(
       file,
       ResType.FILE,
       new XmlContext(resourceTable.getPackageName(), file, qualifiers)));
  }
 }
}

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

boolean gotName = res.getResourceName(curIdent, true, attrName);
boolean gotRefName = res.getResourceName(res_value.data, true, attrRefName);
Logger.warn(
  "Failed to resolve attribute lookup: %s=\"?%s\"; theme: %s",
  gotName ? attrName : "unknown", gotRefName ? attrRefName : "unknown",

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

@Implementation
@HiddenApi
protected void removeSyncBarrier(int token) {
 // TODO(b/74402484): workaround scheduler corruption of message queue
 try {
  directlyOn(realQueue, MessageQueue.class, "removeSyncBarrier", from(int.class, token));
 } catch (IllegalStateException e) {
  Logger.warn("removeSyncBarrier failed! Could not find token %d", token);
 }
}

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

private void loadFile(FsFile dir) {
 if (!dir.exists()) {
  throw new RuntimeException("no such directory " + dir);
 }
 if (!dir.isDirectory()) {
  return;
 }
 Qualifiers qualifiers;
 try {
  qualifiers = Qualifiers.fromParentDir(dir);
 } catch (IllegalArgumentException e) {
  Logger.warn(dir + ": " + e.getMessage());
  return;
 }
 for (FsFile file : dir.listFiles(ENDS_WITH_XML)) {
  loadResourceXmlFile(new XmlContext(packageName, file, qualifiers));
 }
}

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

qualifiers = Qualifiers.fromParentDir(dir);
} catch (IllegalArgumentException e) {
 Logger.warn(dir + ": " + e.getMessage());
 return;

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

private void loadRawFiles(PackageResourceTable resourceTable, String resourceType, FsFile rawDir) {
  FsFile[] files = rawDir.listFiles();
  if (files != null) {
   Qualifiers qualifiers;
   try {
    qualifiers = Qualifiers.fromParentDir(rawDir);
   } catch (IllegalArgumentException e) {
    Logger.warn(rawDir + ": " + e.getMessage());
    return;
   }

   for (FsFile file : files) {
    String fileBaseName = file.getBaseName();
    resourceTable.addResource(resourceType, fileBaseName,
      new FileTypedResource(file, ResType.FILE,
        new XmlContext(resourceTable.getPackageName(), file, qualifiers)));
   }
  }
 }
}

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

boolean gotName = res.getResourceName(curIdent, true, attrName);
boolean gotRefName = res.getResourceName(res_value.data, true, attrRefName);
Logger.warn(
  "Failed to resolve attribute lookup: %s=\"?%s\"; theme: %s",
  gotName ? attrName : "unknown", gotRefName ? attrRefName : "unknown",

相关文章