本文整理了Java中org.modeshape.jcr.api.Logger.debug()
方法的一些代码示例,展示了Logger.debug()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.debug()
方法的具体详情如下:
包路径:org.modeshape.jcr.api.Logger
类名称:Logger
方法名:debug
[英]Log a message at the DEBUG level according to the specified format and (optional) parameters. The message should contain a pair of empty curly braces for each of the parameter, which should be passed in the correct order. The pattern consists of zero or more keys of the form {n}
, where n
is an integer starting at 0. Therefore, the first parameter replaces all occurrences of "{0}", the second parameter replaces all occurrences of "{1}", etc.
If any parameter is null, the corresponding key is replaced with the string "null". Therefore, consider using an empty string when keys are to be removed altogether.
[中]根据指定的格式和(可选)参数在调试级别记录消息。消息应该为每个参数包含一对空大括号,并且应该按照正确的顺序传递。该模式由格式为{n}
的零个或多个键组成,其中n
是从0开始的整数。因此,第一个参数替换所有出现的“{0}”,第二个参数替换所有出现的“{1}”,等等。
如果任何参数为null,则相应的键将替换为字符串“null”。因此,当键被完全移除时,考虑使用一个空字符串。
代码示例来源:origin: ModeShape/modeshape
private BasicFileAttributes basicAttributesFor( File file ) {
Path filePath = Paths.get(file.toURI());
try {
return Files.readAttributes(filePath, BasicFileAttributes.class);
} catch (IOException e) {
log().debug(e, "Unable to read attributes for '{0}'", filePath);
return null;
}
}
代码示例来源:origin: org.fcrepo/modeshape-jcr
private Name primaryTypeFor( Path resolvedPath ) {
boolean isFolder = Files.isDirectory(resolvedPath, LinkOption.NOFOLLOW_LINKS);
boolean isFile = Files.isRegularFile(resolvedPath, LinkOption.NOFOLLOW_LINKS);
if (!isFile && !isFolder) {
connector.log().debug("The entry at {0} is neither a file nor a folder", resolvedPath);
return null;
}
return isFolder ? JcrNtLexicon.FOLDER : JcrNtLexicon.FILE;
}
}
代码示例来源:origin: ModeShape/modeshape
private Name primaryTypeFor( Path resolvedPath ) {
boolean isFolder = Files.isDirectory(resolvedPath, LinkOption.NOFOLLOW_LINKS);
boolean isFile = Files.isRegularFile(resolvedPath, LinkOption.NOFOLLOW_LINKS);
if (!isFile && !isFolder) {
connector.log().debug("The entry at {0} is neither a file nor a folder", resolvedPath);
return null;
}
return isFolder ? JcrNtLexicon.FOLDER : JcrNtLexicon.FILE;
}
}
代码示例来源:origin: org.fcrepo/modeshape-jcr
private BasicFileAttributes basicAttributesFor( File file ) {
Path filePath = Paths.get(file.toURI());
try {
return Files.readAttributes(filePath, BasicFileAttributes.class);
} catch (IOException e) {
log().debug(e, "Unable to read attributes for '{0}'", filePath);
return null;
}
}
代码示例来源:origin: ModeShape/modeshape
/**
* Cleans up any resources related to {@link AbstractHandler#ACTIVE_SESSION}
*/
public static void cleanupActiveSession() {
Session session = AbstractHandler.ACTIVE_SESSION.get();
if (session != null) {
try {
AbstractHandler.ACTIVE_SESSION.remove();
session.logout();
LOGGER.debug("Logged out REST service session");
} catch (Exception e) {
LOGGER.warn(e, "Error while trying to logout REST service session");
}
}
}
代码示例来源:origin: ModeShape/modeshape
@Override
public void filter( ContainerRequestContext requestContext ) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Received request: {0}", requestContext.getUriInfo().getRequestUri().toString());
LOGGER.debug("Executing method: {0}", requestContext.getMethod());
}
}
}
代码示例来源:origin: org.fcrepo/modeshape-jcr
private void recursiveWatch( Path path,
final WatchService watchService ) {
connector.log().debug("Recursively watching '{0}'", path);
try {
Files.walkFileTree(path, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult preVisitDirectory( Path dir,
BasicFileAttributes attrs ) throws IOException {
if (WATCH_MODIFIER != null) {
dir.register(watchService, EVENTS_TO_WATCH, WATCH_MODIFIER);
} else {
dir.register(watchService, EVENTS_TO_WATCH);
}
return FileVisitResult.CONTINUE;
}
});
} catch (IOException e) {
throw new RuntimeException(e);
}
}
代码示例来源:origin: ModeShape/modeshape
private Response exceptionResponse( Throwable t,
Status status ) {
switch (status) {
case NOT_FOUND: {
LOGGER.debug(t, "Item not found");
break;
}
default: {
LOGGER.error(t, "Server error");
break;
}
}
return Response.status(status).entity(new RestException(t)).build();
}
}
代码示例来源:origin: ModeShape/modeshape
private String ownerFor( File file ) {
Path filePath = Paths.get(file.toURI());
try {
return Files.getOwner(filePath).getName();
} catch (IOException e) {
log().debug(e, "Unable to read the owner of '{0}'", filePath);
return null;
}
}
代码示例来源:origin: org.fcrepo/modeshape-jcr
private String ownerFor( File file ) {
Path filePath = Paths.get(file.toURI());
try {
return Files.getOwner(filePath).getName();
} catch (IOException e) {
log().debug(e, "Unable to read the owner of '{0}'", filePath);
return null;
}
}
代码示例来源:origin: ModeShape/modeshape
private void convertStringMimeTypesToMediaTypes(Set<String> mimeTypes, Set<MediaType> mediaTypes) {
for (String mimeTypeEntry : mimeTypes) {
//allow each mime type entry to be an array in itself
String[] multipleMimeTypes = mimeTypeEntry.split("[,\\s]");
for (String mimeType : multipleMimeTypes) {
if (StringUtil.isBlank(mimeType)) {
continue;
}
MediaType mediaType = MediaType.parse(mimeType.trim());
if (mediaType == null) {
logger().debug("Invalid media type: {0}", mimeType);
continue;
}
mediaTypes.add(mediaType);
}
}
}
代码示例来源:origin: ModeShape/modeshape
@Override
protected void doInitialize() throws RepositoryException {
logger().debug("Elasticsearch index provider for repository '{0}' "
+ "is trying to connect to cluster", getRepositoryName());
client = new EsClient(host, port);
}
代码示例来源:origin: ModeShape/modeshape
@Override
protected void postShutdown() {
logger().debug("Shutting down the elasticsearch index provider '{0}' in repository '{1}'", getName(), getRepositoryName());
}
代码示例来源:origin: ModeShape/modeshape
@Override
public RepositoryInfo getRepositoryInfo(String repositoryId, ExtensionsData extension) {
LOGGER.debug("-- getting repository info");
RepositoryInfo info = jcrRepository(repositoryId).getRepositoryInfo(login(repositoryId));
return new RepositoryInfoLocal(repositoryId, info);
}
代码示例来源:origin: ModeShape/modeshape
@SuppressWarnings( "synthetic-access" )
@Override
public void beforeIndexing() {
logger().debug(
"Disabling index '{0}' from provider '{1}' in workspace '{2}' while it is reindexed. It will not be used in queries until reindexing has completed",
defn.getName(), defn.getProviderName(), workspaceName);
managedIndex.enable(false);
}
代码示例来源:origin: org.fcrepo/modeshape-jcr
@SuppressWarnings( "synthetic-access" )
@Override
public void beforeIndexing() {
logger().debug(
"Disabling index '{0}' from provider '{1}' in workspace '{2}' while it is reindexed. It will not be used in queries until reindexing has completed",
defn.getName(), defn.getProviderName(), workspaceName);
managedIndex.enable(false);
}
代码示例来源:origin: ModeShape/modeshape
@SuppressWarnings( "synthetic-access" )
@Override
public void afterIndexing() {
managedIndex.enable(true);
logger().debug("Enabled index '{0}' from provider '{1}' in workspace '{2}' after reindexing has completed",
defn.getName(), defn.getProviderName(), workspaceName);
}
代码示例来源:origin: org.fcrepo/modeshape-jcr
@SuppressWarnings( "synthetic-access" )
@Override
public void afterIndexing() {
managedIndex.enable(true);
logger().debug("Enabled index '{0}' from provider '{1}' in workspace '{2}' after reindexing has completed",
defn.getName(), defn.getProviderName(), workspaceName);
}
代码示例来源:origin: ModeShape/modeshape
@Override
protected void postShutdown() {
logger().debug("Shutting down the local index provider '{0}' in repository '{1}'", getName(), getRepositoryName());
if (db != null && !db.isClosed()) {
try {
db.commit();
db.close();
} finally {
db = null;
}
}
}
代码示例来源:origin: org.fcrepo/modeshape-jcr
@Override
protected void postShutdown() {
logger().debug("Shutting down the local index provider '{0}' in repository '{1}'", getName(), getRepositoryName());
if (db != null && !db.isClosed()) {
try {
db.commit();
db.close();
} finally {
db = null;
}
}
}
内容来源于网络,如有侵权,请联系作者删除!