本文整理汇总了Java中org.hsqldb.lib.SimpleLog类的典型用法代码示例。如果您正苦于以下问题:Java SimpleLog类的具体用法?Java SimpleLog怎么用?Java SimpleLog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SimpleLog类属于org.hsqldb.lib包,在下文中一共展示了SimpleLog类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setEventLogLevel
import org.hsqldb.lib.SimpleLog; //导入依赖的package包/类
public void setEventLogLevel(int level, boolean logSql) {
if (level < SimpleLog.LOG_NONE || level > SimpleLog.LOG_RESULT) {
throw Error.error(ErrorCode.X_42556);
}
if (logSql) {
propSqlLogLevel = level;
sqlLog.setLevel(level);
} else {
if (level > SimpleLog.LOG_DETAIL) {
level = SimpleLog.LOG_DETAIL;
}
propEventLogLevel = level;
appLog.setLevel(level);
}
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:21,代码来源:Logger.java
示例2: logSevereEvent
import org.hsqldb.lib.SimpleLog; //导入依赖的package包/类
public void logSevereEvent(String message, Throwable t) {
getEventLogger();
if (fwLogger != null) {
fwLogger.severe(message, t);
}
if (appLog != null) {
if (t == null) {
appLog.logContext(SimpleLog.LOG_ERROR, message);
} else {
appLog.logContext(t, message, SimpleLog.LOG_ERROR);
}
}
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:17,代码来源:Logger.java
示例3: save
import org.hsqldb.lib.SimpleLog; //导入依赖的package包/类
public void save() {
if (!DatabaseURL.isFileBasedDatabaseType(database.getType())
|| database.isFilesReadOnly() || database.isFilesInJar()) {
return;
}
try {
super.save(fileName + ".properties" + ".new");
fa.renameElement(fileName + ".properties" + ".new",
fileName + ".properties");
} catch (Exception e) {
database.logger.appLog.logContext(SimpleLog.LOG_ERROR, "failed");
throw Error.error(ErrorCode.FILE_IO_ERROR,
ErrorCode.M_LOAD_SAVE_PROPERTIES, new Object[] {
fileName, e
});
}
}
开发者ID:s-store,项目名称:sstore-soft,代码行数:21,代码来源:HsqlDatabaseProperties.java
示例4: endTransaction
import org.hsqldb.lib.SimpleLog; //导入依赖的package包/类
private void endTransaction(boolean commit) {
sessionData.updateLobUsage(commit);
sessionContext.savepoints.clear();
sessionContext.savepointTimestamps.clear();
rowActionList.clear();
sessionData.persistentStoreCollection.clearTransactionTables();
sessionData.closeAllTransactionNavigators();
isReadOnly = isReadOnlyDefault;
isolationMode = isolationModeDefault;
lockStatement = null;
/* debug 190
tempActionHistory.add("commit ends " + actionTimestamp);
tempActionHistory.clear();
//*/
if (database != null && database.logger.needsCheckpoint()) {
try {
database.logger.checkpoint(false);
} catch (HsqlException e) {
database.logger.appLog.logContext(
SimpleLog.LOG_ERROR, "checkpoint did not complete");
}
}
}
开发者ID:s-store,项目名称:sstore-soft,代码行数:27,代码来源:Session.java
示例5: readDDL
import org.hsqldb.lib.SimpleLog; //导入依赖的package包/类
protected void readDDL(Session session) throws IOException {
Result r = Result.newResult(dataStreamIn, rowIn);
r.readAdditionalResults(session, dataStreamIn, rowIn);
RowSetNavigator nav = r.initialiseNavigator();
while (nav.hasNext()) {
Object[] data = (Object[]) nav.getNext();
String s = (String) data[0];
Result result = session.executeDirectStatement(s);
if (result.isError()) {
db.logger.appLog.logContext(SimpleLog.LOG_ERROR,
result.getMainString());
throw Error.error(result);
}
}
}
开发者ID:s-store,项目名称:sstore-soft,代码行数:22,代码来源:ScriptReaderBinary.java
示例6: save
import org.hsqldb.lib.SimpleLog; //导入依赖的package包/类
public void save() throws HsqlException {
if (!DatabaseURL.isFileBasedDatabaseType(database.getType())
|| database.isFilesReadOnly() || database.isFilesInJar()) {
return;
}
try {
super.save(fileName + ".properties" + ".new");
fa.renameElement(fileName + ".properties" + ".new",
fileName + ".properties");
} catch (Exception e) {
database.logger.appLog.logContext(SimpleLog.LOG_ERROR, "failed");
throw Trace.error(Trace.FILE_IO_ERROR, Trace.LOAD_SAVE_PROPERTIES,
new Object[] {
fileName, e
});
}
}
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:21,代码来源:HsqlDatabaseProperties.java
示例7: readDDL
import org.hsqldb.lib.SimpleLog; //导入依赖的package包/类
protected void readDDL(Session session)
throws IOException, HsqlException {
Result r = Result.read(rowIn, dataStreamIn);
Iterator it = r.iterator();
while (it.hasNext()) {
Object[] data = (Object[]) it.next();
String s = (String) data[0];
Result result = session.sqlExecuteDirectNoPreChecks(s);
if (result.isError()) {
db.logger.appLog.logContext(SimpleLog.LOG_ERROR,
result.getMainString());
/** @todo fredt - trap if unavaialble external functions are to be ignored */
throw Trace.error(result);
}
}
}
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:21,代码来源:ScriptReaderBinary.java
示例8: setEventLogLevel
import org.hsqldb.lib.SimpleLog; //导入依赖的package包/类
public void setEventLogLevel(int level, boolean sqlLog) {
if (level < SimpleLog.LOG_NONE || level > SimpleLog.LOG_DETAIL) {
throw Error.error(ErrorCode.X_42556);
}
if (sqlLog) {
propSqlLogLevel = level;
this.sqlLog.setLevel(level);
} else {
propEventLogLevel = level;
appLog.setLevel(level);
}
}
开发者ID:RabadanLab,项目名称:Pegasus,代码行数:17,代码来源:Logger.java
示例9: getEventLogger
import org.hsqldb.lib.SimpleLog; //导入依赖的package包/类
/**
* All usage of FrameworkLogger should call this method before using an
* instance.
*
* It ensures and requires that no logging should take place before a new
* database unique name has been created for a new database or read from the
* .script file for an old database.<p>
*
* An instance is returned when:
* - database unique name has been created
* - FrameworkLogger would use log4j
*
* Otherwise null is returned.
*
* This tactic avoids usage of file-based jdk logging for the time being.
*
*/
private void getEventLogger() {
if (fwLogger != null) {
return;
}
String name = database.getNameString();
if (name == null) {
// The database unique name is set up at different times
// depending on upgraded / exiting / new databases.
// Therefore FrameworkLogger is not used until the unique
// name is known.
return;
}
fwLogger = FrameworkLogger.getLog(SimpleLog.logTypeNameEngine,
"hsqldb.db."
+ database.getNameString());
/*
sqlLogger = FrameworkLogger.getLog(SimpleLog.logTypeNameEngine,
"hsqldb.sql."
+ database.getUniqueName());
*/
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:44,代码来源:Logger.java
示例10: logDetailEvent
import org.hsqldb.lib.SimpleLog; //导入依赖的package包/类
public void logDetailEvent(String message) {
getEventLogger();
if (fwLogger != null) {
fwLogger.finest(message);
}
if (appLog != null) {
appLog.logContext(SimpleLog.LOG_DETAIL, message);
}
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:13,代码来源:Logger.java
示例11: endTransaction
import org.hsqldb.lib.SimpleLog; //导入依赖的package包/类
private void endTransaction(boolean commit, boolean chain) {
abortTransaction = false;
sessionContext.resetStack();
sessionContext.savepoints.clear();
sessionContext.savepointTimestamps.clear();
rowActionList.clear();
sessionData.persistentStoreCollection.clearTransactionTables();
sessionData.closeAllTransactionNavigators();
sessionData.clearLobOps();
if (!chain) {
sessionContext.isReadOnly = isReadOnlyDefault ? Boolean.TRUE
: Boolean.FALSE;
setIsolation(isolationLevelDefault);
}
if (database.logger.getSqlEventLogLevel() > 0) {
Statement endTX = commit ? StatementSession.commitNoChainStatement
: StatementSession
.rollbackNoChainStatement;
database.logger.logStatementEvent(this, endTX, null,
Result.updateZeroResult,
SimpleLog.LOG_ERROR);
}
/* debug 190
tempActionHistory.add("commit ends " + actionTimestamp);
tempActionHistory.clear();
//*/
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:34,代码来源:Session.java
示例12: closeLog
import org.hsqldb.lib.SimpleLog; //导入依赖的package包/类
/**
* Shuts down the logging process using the specified mode. <p>
*
* @param closemode The mode in which to shut down the logging
* process
* <OL>
* <LI> closemode -1 performs SHUTDOWN IMMEDIATELY, equivalent
* to a poweroff or crash.
* <LI> closemode 0 performs a normal SHUTDOWN that
* checkpoints the database normally.
* <LI> closemode 1 performs a shutdown compact that scripts
* out the contents of any CACHED tables to the log then
* deletes the existing *.data file that contains the data
* for all CACHED table before the normal checkpoint process
* which in turn creates a new, compact *.data file.
* <LI> closemode 2 performs a SHUTDOWN SCRIPT.
* </OL>
*
* @return true if closed with no problems or false if a problem was
* encountered.
*/
public boolean closeLog(int closemode) {
if (log == null) {
return true;
}
try {
switch (closemode) {
case Database.CLOSEMODE_IMMEDIATELY :
log.shutdown();
break;
case Database.CLOSEMODE_NORMAL :
log.close(false);
break;
case Database.CLOSEMODE_COMPACT :
case Database.CLOSEMODE_SCRIPT :
log.close(true);
break;
}
} catch (Throwable e) {
appLog.logContext(e, "error closing log");
appLog.close();
log = null;
return false;
}
appLog.sendLine(SimpleLog.LOG_ERROR, "Database closed");
appLog.close();
log = null;
return true;
}
开发者ID:s-store,项目名称:sstore-soft,代码行数:60,代码来源:Logger.java
示例13: getEventLogger
import org.hsqldb.lib.SimpleLog; //导入依赖的package包/类
/**
* All usage of FrameworkLogger should call this method before using an
* instance.
*
* It ensures and requires that no logging should take place before a new
* database unique name has been created for a new database or read from the
* .script file for an old database.<p>
*
* An instance is returned when:
* - database unique name has been created
* - FrameworkLogger would use log4j
*
* Otherwise null is returned.
*
* This tactic avoids usage of file-based jdk logging for the time being.
*
*/
private void getEventLogger() {
if (fwLogger != null) {
return;
}
String name = database.getUniqueName();
if (name == null) {
// The database unique name is set up at different times
// depending on upgraded / exiting / new databases.
// Therefore FrameworkLogger is not used until the unique
// name is known.
return;
}
fwLogger = FrameworkLogger.getLog(SimpleLog.logTypeNameEngine,
"hsqldb.db."
+ database.getUniqueName());
/*
sqlLogger = FrameworkLogger.getLog(SimpleLog.logTypeNameEngine,
"hsqldb.sql."
+ database.getUniqueName());
*/
}
开发者ID:Julien35,项目名称:dev-courses,代码行数:44,代码来源:Logger.java
示例14: endTransaction
import org.hsqldb.lib.SimpleLog; //导入依赖的package包/类
private void endTransaction(boolean commit, boolean chain) {
sessionContext.resetStack();
sessionContext.savepoints.clear();
sessionContext.savepointTimestamps.clear();
rowActionList.clear();
sessionData.persistentStoreCollection.clearTransactionTables();
sessionData.closeAllTransactionNavigators();
sessionData.clearLobOps();
lockStatement = null;
logSequences();
if (!chain) {
sessionContext.isReadOnly = isReadOnlyDefault ? Boolean.TRUE
: Boolean.FALSE;
setIsolation(isolationLevelDefault);
}
Statement endTX = commit ? StatementSession.commitNoChainStatement
: StatementSession.rollbackNoChainStatement;
if (database.logger.getSqlEventLogLevel() > 0) {
database.logger.logStatementEvent(this, endTX, null,
Result.updateZeroResult,
SimpleLog.LOG_ERROR);
}
/* debug 190
tempActionHistory.add("commit ends " + actionTimestamp);
tempActionHistory.clear();
//*/
}
开发者ID:Julien35,项目名称:dev-courses,代码行数:35,代码来源:Session.java
示例15: copy
import org.hsqldb.lib.SimpleLog; //导入依赖的package包/类
private void copy(int pageOffset) throws IOException {
if (bitMap.set(pageOffset) == 1) {
return;
}
long position = (long) pageOffset * pageSize;
int readSize = pageSize;
if (maxSize - position < pageSize) {
readSize = (int) (maxSize - position);
}
try {
if (dest == null) {
open();
}
long writePos = dest.length();
byte[] buffer = new byte[pageSize + 12];
byteArrayOutputStream.setBuffer(buffer);
byteArrayOutputStream.writeInt(pageSize);
byteArrayOutputStream.writeLong(position);
source.seek(position);
source.read(buffer, 12, readSize);
dest.seek(writePos);
dest.write(buffer);
} catch (Throwable t) {
bitMap.unset(pageOffset);
close();
database.logger.appLog.logContext(SimpleLog.LOG_ERROR,
"pos" + position + " "
+ readSize);
throw FileUtil.toIOException(t);
} finally {}
}
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:39,代码来源:RAShadowFile.java
示例16: readDDL
import org.hsqldb.lib.SimpleLog; //导入依赖的package包/类
protected void readDDL(Session session) throws IOException, HsqlException {
for (; readLoggedStatement(session); ) {
if (rowIn.getStatementType() == INSERT_STATEMENT) {
isInsert = true;
break;
}
Result result = session.sqlExecuteDirectNoPreChecks(statement);
if (result != null && result.isError()) {
db.logger.appLog.logContext(SimpleLog.LOG_ERROR,
result.getMainString());
HsqlException error =
Trace.error(Trace.ERROR_IN_SCRIPT_FILE,
Trace.DatabaseScriptReader_readDDL,
new Object[] {
new Integer(lineCount), result.getMainString()
});
/** @todo fredt - if unavaialble external functions are to be ignored */
throw error;
}
}
}
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:28,代码来源:ScriptReaderText.java
示例17: copy
import org.hsqldb.lib.SimpleLog; //导入依赖的package包/类
private void copy(int pageOffset) throws IOException {
if (bitMap.set(pageOffset) == 1) {
return;
}
long position = (long) pageOffset * pageSize;
int readSize = pageSize;
if (maxSize - position < pageSize) {
readSize = (int) (maxSize - position);
}
try {
if (dest == null) {
open();
}
long writePos = dest.length();
byte[] buffer = new byte[pageSize + 12];
byteArrayOutputStream.setBuffer(buffer);
byteArrayOutputStream.writeInt(pageSize);
byteArrayOutputStream.writeLong(position);
source.seek(position);
source.read(buffer, 12, readSize);
dest.seek(writePos);
dest.write(buffer, 0, buffer.length);
} catch (Throwable t) {
bitMap.unset(pageOffset);
close();
database.logger.appLog.logContext(SimpleLog.LOG_ERROR,
"pos" + position + " "
+ readSize);
throw FileUtil.toIOException(t);
} finally {}
}
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:39,代码来源:RAShadowFile.java
示例18: logStatementEvent
import org.hsqldb.lib.SimpleLog; //导入依赖的package包/类
public void logStatementEvent(Session session, Statement statement,
Object[] paramValues, int level) {
getEventLogger();
if (sqlLogger != null) {
sqlLogger.finest(statement.getSQL());
}
if (sqlLog != null && level <= propSqlLogLevel) {
String sessionId = Long.toString(session.getId());
String sql = statement.getSQL();
String values = "";
if (sql.length() > 100) {
sql.substring(0, 100);
}
if (level == SimpleLog.LOG_DETAIL) {
if (paramValues != null && paramValues.length > 0) {
values = RowType.convertToSQLString(
paramValues,
statement.getParametersMetaData().getParameterTypes(),
32);
}
}
sqlLog.logContext(SimpleLog.LOG_DETAIL, sessionId, sql, values);
}
}
开发者ID:RabadanLab,项目名称:Pegasus,代码行数:31,代码来源:Logger.java
注:本文中的org.hsqldb.lib.SimpleLog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论