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

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

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

  1. private static Implementation getImplementationAnnotation(Method method) {
  2. if (method == null) {
  3. return null;
  4. }
  5. Implementation implementation = method.getAnnotation(Implementation.class);
  6. if (implementation == null) {
  7. Logger.warn("No @Implementation annotation on " + method);
  8. }
  9. return implementation == null
  10. ? IMPLEMENTATION_DEFAULTS
  11. : implementation;
  12. }

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

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

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

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

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

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

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

  1. private void loadFile(Path dir) throws IOException {
  2. if (!Files.exists(dir)) {
  3. throw new RuntimeException("no such directory " + dir);
  4. }
  5. if (!Files.isDirectory(dir)) {
  6. return;
  7. }
  8. Qualifiers qualifiers;
  9. try {
  10. qualifiers = Qualifiers.fromParentDir(dir);
  11. } catch (IllegalArgumentException e) {
  12. Logger.warn(dir + ": " + e.getMessage());
  13. return;
  14. }
  15. for (Path file : Fs.listFiles(dir, path -> path.getFileName().toString().endsWith(".xml"))) {
  16. loadResourceXmlFile(new XmlContext(packageName, file, qualifiers));
  17. }
  18. }

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

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

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

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

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

  1. private void loadRawFiles(PackageResourceTable resourceTable, String resourceType, Path rawDir)
  2. throws IOException {
  3. Qualifiers qualifiers;
  4. try {
  5. qualifiers = Qualifiers.fromParentDir(rawDir);
  6. } catch (IllegalArgumentException e) {
  7. Logger.warn(rawDir + ": " + e.getMessage());
  8. return;
  9. }
  10. for (Path file : Fs.listFiles(rawDir)) {
  11. String fileBaseName = Fs.baseNameFor(file);
  12. resourceTable.addResource(
  13. resourceType,
  14. fileBaseName,
  15. new FileTypedResource(
  16. file,
  17. ResType.FILE,
  18. new XmlContext(resourceTable.getPackageName(), file, qualifiers)));
  19. }
  20. }
  21. }

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

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

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

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

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

  1. private void loadFile(FsFile dir) {
  2. if (!dir.exists()) {
  3. throw new RuntimeException("no such directory " + dir);
  4. }
  5. if (!dir.isDirectory()) {
  6. return;
  7. }
  8. Qualifiers qualifiers;
  9. try {
  10. qualifiers = Qualifiers.fromParentDir(dir);
  11. } catch (IllegalArgumentException e) {
  12. Logger.warn(dir + ": " + e.getMessage());
  13. return;
  14. }
  15. for (FsFile file : dir.listFiles(ENDS_WITH_XML)) {
  16. loadResourceXmlFile(new XmlContext(packageName, file, qualifiers));
  17. }
  18. }

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

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

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

  1. private void loadRawFiles(PackageResourceTable resourceTable, String resourceType, FsFile rawDir) {
  2. FsFile[] files = rawDir.listFiles();
  3. if (files != null) {
  4. Qualifiers qualifiers;
  5. try {
  6. qualifiers = Qualifiers.fromParentDir(rawDir);
  7. } catch (IllegalArgumentException e) {
  8. Logger.warn(rawDir + ": " + e.getMessage());
  9. return;
  10. }
  11. for (FsFile file : files) {
  12. String fileBaseName = file.getBaseName();
  13. resourceTable.addResource(resourceType, fileBaseName,
  14. new FileTypedResource(file, ResType.FILE,
  15. new XmlContext(resourceTable.getPackageName(), file, qualifiers)));
  16. }
  17. }
  18. }
  19. }

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

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

相关文章