| | |
| | | * java打印 |
| | | * |
| | | * @param content 自定义信息描述 |
| | | * 默认不加入本地日志 |
| | | */ |
| | | public static void print(String content) { |
| | | printBase(content, "0", false); |
| | |
| | | */ |
| | | public static void writeLog(String strLog) { |
| | | synchronized (HdlLogLogic.class) { |
| | | strLog = TimeUtils.getTimeFromTimestamp(System.currentTimeMillis()) + "s%" + " " + strLog;//加打印时间(s%占位符,显示时间时设置不同字体颜色) |
| | | HdlFileLogic.getInstance().appendFile(HdlFileLogic.getInstance().getLogFilePath(), strLog); |
| | | strLog = TimeUtils.getTimeFromTimestamp(System.currentTimeMillis()) + "s%" + " " + strLog;//加打印时间(s%占位符,设置显示时间不同字体颜色) |
| | | HdlFileLogic.getInstance().appendFile(HdlFileLogic.getInstance().getLogFileNamePath(), strLog); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return 日志内容 |
| | | */ |
| | | public static String readLog() { |
| | | return HdlFileLogic.getInstance().readFile(HdlFileLogic.getInstance().getLogFilePath()); |
| | | return HdlFileLogic.getInstance().readFile(HdlFileLogic.getInstance().getLogFileNamePath()); |
| | | } |
| | | |
| | | |