本文整理汇总了Java中org.apache.jena.atlas.logging.FmtLog.error方法的典型用法代码示例。如果您正苦于以下问题:Java FmtLog.error方法的具体用法?Java FmtLog.error怎么用?Java FmtLog.error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.jena.atlas.logging.FmtLog
的用法示例。
在下文中一共展示了FmtLog.error方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initSystem
import org.apache.jena.atlas.logging.FmtLog; //导入方法依赖的package包/类
/** After Delta has initialized, make sure some sort of PatchStore provision is set. */
static private void initSystem() {
// Ensure the file-based PatchStore provider is available
if ( ! PatchStoreMgr.isRegistered(DPS.PatchStoreFileProvider) ) {
FmtLog.warn(LOG, "PatchStoreFile provider not registered");
PatchStore ps = new PatchStoreFile();
if ( ! DPS.PatchStoreFileProvider.equals(ps.getProviderName())) {
FmtLog.error(LOG, "PatchStoreFile provider name is wrong (expected=%s, got=%s)", DPS.PatchStoreFileProvider, ps.getProviderName());
throw new DeltaConfigException();
}
PatchStoreMgr.register(ps);
}
// if ( ! PatchStoreMgr.isRegistered(DPS.PatchStoreMemProvider) ) {
// PatchStore psMem = new PatchStoreMem(DPS.PatchStoreMemProvider);
// PatchStoreMgr.register(psMem);
// }
// Default the log provider to "file"
if ( PatchStoreMgr.getDftPatchStore() == null ) {
//FmtLog.warn(LOG, "PatchStore default not set.");
PatchStoreMgr.setDftPatchStoreName(DPS.PatchStoreFileProvider);
}
}
示例2: deleteTmpFiles
import org.apache.jena.atlas.logging.FmtLog; //导入方法依赖的package包/类
/** Find the indexes of files in this FileStore. Return sorted, low to high. */
private static boolean deleteTmpFiles(Path directory) {
boolean found = false;
try (DirectoryStream<Path> stream = Files.newDirectoryStream(directory, tmpBasename + "*")) {
for ( Path f : stream ) {
found = true;
Files.delete(f);
if ( Files.exists(f) )
FmtLog.error(LOG, "Failed to delete tmp file: %s", f);
}
} catch (IOException ex) {
FmtLog.warn(LOG, "Can't check directory for tmp files: %s", directory);
throw new PatchException(ex);
}
return found;
}
示例3: validateLatest
import org.apache.jena.atlas.logging.FmtLog; //导入方法依赖的package包/类
private void validateLatest() {
if ( CHECKING ) {
long x = fileStore.getCurrentIndex();
// latestVersion = -1 (UNSET) and getCurrentIndex==0 (INIT) is OK
if ( latestVersion == VERSION_UNSET ) {
if ( x != VERSION_INIT )
FmtLog.error(LOG, "Out of sync: latestVersion=%s, fileStore=%s", latestVersion, x);
} else if ( x > VERSION_INIT ) {
// Legal versions start 1.
if ( latestVersion != x )
FmtLog.error(LOG, "Out of sync: latestVersion=%s, fileStore=%s", latestVersion, x);
}
else if ( latestVersion > VERSION_INIT ) {
FmtLog.error(LOG, "Out of sync: latestVersion=%s, fileStore=%s", latestVersion, x);
}
}
}
示例4: copy
import org.apache.jena.atlas.logging.FmtLog; //导入方法依赖的package包/类
/** Copy a file, not atomic. *
* Can copy to a directory or over an existing file.
* @param srcFilename
* @param dstFilename
*/
public static void copy(String srcFilename, String dstFilename) {
Path src = Paths.get(srcFilename);
if ( ! Files.exists(src) )
throw new RuntimeIOException("No such file: "+srcFilename);
Path dst = Paths.get(dstFilename);
if ( Files.isDirectory(dst) )
dst = dst.resolve(src.getFileName());
try { Files.copy(src, dst); }
catch (IOException ex) {
FmtLog.error(IOX.class, ex, "IOException copying %s to %s", srcFilename, dstFilename);
throw IOX.exception(ex);
}
}
示例5: move
import org.apache.jena.atlas.logging.FmtLog; //导入方法依赖的package包/类
/** Atomically move a file. */
public static void move(Path src, Path dst) {
try { Files.move(src, dst, StandardCopyOption.ATOMIC_MOVE) ; }
catch (IOException ex) {
FmtLog.error(IOX.class, ex, "IOException moving %s to %s", src, dst);
throw IOX.exception(ex);
}
}
示例6: call
import org.apache.jena.atlas.logging.FmtLog; //导入方法依赖的package包/类
protected <T> T call(String label, ThriftCallable<T> action) {
checkRunning() ;
completeAsyncOperations();
try { return ThriftLib.call(lock, action) ; }
catch (Exception ex) {
FmtLog.error(getLog(), ex, label) ;
throw new LizardException(ex) ;
}
}
示例7: exec
import org.apache.jena.atlas.logging.FmtLog; //导入方法依赖的package包/类
protected void exec(String label, ThriftRunnable action) {
checkRunning() ;
completeAsyncOperations();
try { ThriftLib.exec(lock, action) ; }
catch (Exception ex) {
FmtLog.error(getLog(), ex, label) ;
throw new LizardException(ex) ;
}
}
示例8: start
import org.apache.jena.atlas.logging.FmtLog; //导入方法依赖的package包/类
@Override
public void start() {
if ( super.isRunning() ) {
FmtLog.error(log, "Already started (%s)", getLabel()) ;
return ;
}
FmtLog.debug(log, "Start: %s", getLabel()) ;
startProtocol() ;
super.start() ;
}
示例9: badPatchError
import org.apache.jena.atlas.logging.FmtLog; //导入方法依赖的package包/类
private void badPatchError(String fmt, Object...args) {
FmtLog.error(LOG, String.format(fmt, args));
}