|
From: <tr...@us...> - 2003-08-12 00:25:35
|
Update of /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/journal/simple
In directory sc8-pr-cvs1:/tmp/cvs-serv26483
Modified Files:
SimpleJournal.java
Log Message:
Fixed issues with reading journal log.
Index: SimpleJournal.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/journal/simple/SimpleJournal.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** SimpleJournal.java 19 Jul 2003 15:32:27 -0000 1.6
--- SimpleJournal.java 12 Aug 2003 00:11:24 -0000 1.7
***************
*** 68,71 ****
--- 68,72 ----
import com.babeldoc.core.I18n;
import com.babeldoc.core.LogService;
+ import com.babeldoc.core.VariableProcessor;
import com.babeldoc.core.config.ConfigService;
import com.babeldoc.core.journal.*;
***************
*** 81,84 ****
--- 82,87 ----
import java.util.Date;
+ import org.apache.commons.lang.NumberUtils;
+
/**
***************
*** 148,156 ****
static {
try {
! logFile = com.babeldoc.core.VariableProcessor.expandString(ConfigService.getString(
CONFIG_NAME, JOURNAL_LOGFILE));
logWriter = new FileWriter(logFile, true);
logPrinter = new CSVWriter(logWriter);
! trackerDir = com.babeldoc.core.VariableProcessor.expandString(ConfigService.getString(
CONFIG_NAME, JOURNAL_DIR));
--- 151,159 ----
static {
try {
! logFile = VariableProcessor.expandString(ConfigService.getString(
CONFIG_NAME, JOURNAL_LOGFILE));
logWriter = new FileWriter(logFile, true);
logPrinter = new CSVWriter(logWriter);
! trackerDir = VariableProcessor.expandString(ConfigService.getString(
CONFIG_NAME, JOURNAL_DIR));
***************
*** 159,167 ****
}
! try {
! logMaxSize = Integer.parseInt(ConfigService.getString(CONFIG_NAME,
! JOURNAL_MAXSIZE));
! } catch (Exception e) {
! }
} catch (Exception confx) {
System.out.println(confx);
--- 162,166 ----
}
! logMaxSize = NumberUtils.stringToInt(ConfigService.getString(CONFIG_NAME, JOURNAL_MAXSIZE));
} catch (Exception confx) {
System.out.println(confx);
***************
*** 196,200 ****
}
} catch (IOException iox) {
! throw new JournalException("[SimpleJournal.getAllTicketSteps]", iox);
}
--- 195,199 ----
}
} catch (IOException iox) {
! throw new JournalException("[SimpleJournal.getAllTickets]", iox);
}
***************
*** 233,242 ****
vec.add(qt);
-
- //LogService.getLogger().logDebug("Steps : " + values[1]);
}
}
} catch (IOException iox) {
! throw new JournalException("[SimpleJournal.getAllTicketSteps]", iox);
}
--- 232,241 ----
vec.add(qt);
}
}
} catch (IOException iox) {
! if(!(iox instanceof EOFException)) {
! throw new JournalException("[SimpleJournal.getAllTicketSteps]", iox);
! }
}
***************
*** 328,337 ****
try {
! CSVReader csvReader = new CSVReader(new FileReader(logFile));
! String[] values;
int index = 0;
int count = 0;
boolean found;
-
while (((values = csvReader.getAllFieldsInLine()) != null) &&
(count < jQuery.getNumResults())) {
--- 327,336 ----
try {
! BufferedReader reader = new BufferedReader(new FileReader(logFile));
! CSVReader csvReader = new CSVReader(reader);
! String[] values = null;
int index = 0;
int count = 0;
boolean found;
while (((values = csvReader.getAllFieldsInLine()) != null) &&
(count < jQuery.getNumResults())) {
***************
*** 376,382 ****
}
} catch (IOException iox) {
! throw new JournalException("", iox);
}
return (QueryTicket[]) (vec.toArray(new QueryTicket[0]));
}
--- 375,384 ----
}
} catch (IOException iox) {
! if(!(iox instanceof EOFException)) {
! throw new JournalException("", iox);
! }
}
+
return (QueryTicket[]) (vec.toArray(new QueryTicket[0]));
}
***************
*** 463,467 ****
rollLogFile();
} catch (IOException iox) {
! com.babeldoc.core.LogService.getInstance().logError(iox);
}
--- 465,469 ----
rollLogFile();
} catch (IOException iox) {
! LogService.getInstance().logError(iox);
}
***************
*** 489,492 ****
--- 491,500 ----
logPrinter.put(pstageName);
logPrinter.put(NULL);
+ }
+ logPrinter.nl();
+ try {
+ logWriter.flush();
+ } catch (IOException e) {
+ throw new JournalException("", e);
}
}
|