Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the xml test of loggerPrinter.java is down since the online check library is closed #246

Open
TianQ20 opened this issue Nov 20, 2020 · 0 comments

Comments

@TianQ20
Copy link

TianQ20 commented Nov 20, 2020

Please try to fill all questions below before submitting an issue.

  • Android studio version: 4.1.1
  • Android gradle plugin version: 3.1.0
  • Logger version: 2.2.0
  • Is it flaky or does it happen all the time? all the time.

path: com/orhanobut/logger/LoggerPrinter.java

@Override public void xml(@Nullable String xml) {
    if (Utils.isEmpty(xml)) {
      d("Empty/Null xml content");
      return;
    }
    try {
      Source xmlInput = new StreamSource(new StringReader(xml));
      StreamResult xmlOutput = new StreamResult(new StringWriter());
      Transformer transformer = TransformerFactory.newInstance().newTransformer();
      transformer.setOutputProperty(OutputKeys.INDENT, "yes");
      transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
      transformer.transform(xmlInput, xmlOutput);
      d(xmlOutput.getWriter().toString().replaceFirst(">", ">\n"));
    } catch (TransformerException e) {
      e("Invalid xml");
    }
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant