コード例 #1
0
 public static void init() throws IOException {
   String fileName = LogUtil.caluFileName(Log2FileConf.errRecordDir, Log2FileConf.errFileName);
   File file = LogUtil.getLogFile(fileName, false);
   while (file.exists()) {
     fileName = fileName + ".bak";
     file = new File(fileName);
   }
   currFileName = fileName;
   bfw = LogUtil.getNewBufferedWriter(fileName);
 }
コード例 #2
0
 private static BufferedWriter getBufferedWriter() throws IOException {
   String fileName = LogUtil.caluFileName(Log2FileConf.errRecordDir, Log2FileConf.errFileName);
   if (fileName.split("\\.")[1].equals(currFileName.split("\\.")[1])) {
     return bfw;
   }
   bfw.flush();
   bfw.close();
   currFileName = fileName;
   bfw = LogUtil.getNewBufferedWriter(currFileName);
   return bfw;
 }