Here you can find the source of logException(int type, String RID, String subRID, String propIndication, String error)
public static void logException(int type, String RID, String subRID, String propIndication, String error)
//package com.java2s; //License from project: Apache License import java.io.FileWriter; import java.io.IOException; import java.util.HashMap; import java.util.Map; public class Main { public static final int ET_OUTLINE = 4; public static final Map<Integer, String> logNames = new HashMap<Integer, String>(); public static final Map<Integer, FileWriter> writers = new HashMap<Integer, FileWriter>(); public static void logException(int type, String RID, String subRID, String propIndication, String error) { //System.out.println(error); FileWriter f = getFileWriter(type); try {/*from www. java2 s.com*/ f.write("- [ ] [" + subRID + "](" + getUri(type, RID, subRID) + ") "); f.write("on property `" + propIndication + "`: " + error + "\n"); } catch (IOException e) { e.printStackTrace(); } } public static void logException(int type, String RID, String subRID, String rawError) { //System.out.println(error); FileWriter f = getFileWriter(type); try { f.write("- [ ] [" + subRID + "](" + getUri(type, RID, subRID) + ") " + rawError + "\n"); } catch (IOException e) { e.printStackTrace(); } } public static FileWriter getFileWriter(int type) { FileWriter res = writers.get(type); if (res == null) { String fileName = logNames.get(type); try { res = new FileWriter(fileName); } catch (IOException e) { e.printStackTrace(); } writers.put(type, res); } return res; } public static String getUri(int type, String RID, String subRID) { if (type == ET_OUTLINE) { return "https://www.tbrc.org/#library_work_ViewByOutline-" + subRID + "|" + RID; } return "https://www.tbrc.org/#!rid=" + RID; } }