本文整理匯總了Java中org.apache.log4j.lf5.util.LogFileParser類的典型用法代碼示例。如果您正苦於以下問題:Java LogFileParser類的具體用法?Java LogFileParser怎麽用?Java LogFileParser使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
LogFileParser類屬於org.apache.log4j.lf5.util包,在下文中一共展示了LogFileParser類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: requestOpenMRU
import org.apache.log4j.lf5.util.LogFileParser; //導入依賴的package包/類
/**
* Opens a file in the MRU list.
*/
protected void requestOpenMRU(ActionEvent e) {
String file = e.getActionCommand();
StringTokenizer st = new StringTokenizer(file);
String num = st.nextToken().trim();
file = st.nextToken("\n");
try {
int index = Integer.parseInt(num) - 1;
InputStream in = _mruFileManager.getInputStream(index);
LogFileParser lfp = new LogFileParser(in);
lfp.parse(this);
_mruFileManager.moveToTop(index);
updateMRUList();
} catch (Exception me) {
LogFactor5ErrorDialog error = new LogFactor5ErrorDialog(
getBaseFrame(), "Unable to load file " + file);
}
}
示例2: loadLogFile
import org.apache.log4j.lf5.util.LogFileParser; //導入依賴的package包/類
/**
* Loads and parses a log file.
*/
protected boolean loadLogFile(File file) {
boolean ok = false;
try {
LogFileParser lfp = new LogFileParser(file);
lfp.parse(this);
ok = true;
} catch (IOException e) {
LogFactor5ErrorDialog error = new LogFactor5ErrorDialog(
getBaseFrame(), "Error reading " + file.getName());
}
return ok;
}