DATAGRAPH-224 changed info logging to debu

This commit is contained in:
Michael Hunger
2012-04-11 18:00:58 +02:00
parent 2ff7719ef4
commit d9b39e306e
5 changed files with 12 additions and 11 deletions

View File

@@ -69,7 +69,8 @@ public class CrossStoreNodeEntityState<ENTITY extends NodeBacked> extends Defaul
node = persistentEntity.isUnique() ? template.createUniqueNode(entity) : template.createNode();
persistForeignId(node, id);
setPersistentState(node);
log.info("User-defined constructor called on class " + entity.getClass() + "; created Node [" + entity.getPersistentState() + "]; Updating metamodel");
if (log.isDebugEnabled())
log.debug("User-defined constructor called on class " + entity.getClass() + "; created Node [" + entity.getPersistentState() + "]; Updating metamodel");
template.postEntityCreation(node, type);
} else {
setPersistentState(node);

View File

@@ -67,11 +67,11 @@ public abstract class DelegatingFieldAccessorFactory implements FieldAccessorFac
if (property.isSyntheticField()) return null;
for (final FieldAccessorFactory fieldAccessorFactory : fieldAccessorFactories) {
if (fieldAccessorFactory.accept(property)) {
if (log.isInfoEnabled()) log.info("Factory " + fieldAccessorFactory + " used for field: " + property);
if (log.isDebugEnabled()) log.debug("Factory " + fieldAccessorFactory + " used for field: " + property);
return fieldAccessorFactory;
}
}
if (log.isWarnEnabled()) log.warn("No FieldAccessor configured for field: " + property);
if (log.isInfoEnabled()) log.info("No FieldAccessor configured for field: " + property);
return null;
}

View File

@@ -100,7 +100,7 @@ public abstract class AbstractConstructorEntityInstantiator<STATE> implements En
if (constructor == null)
return null;
log.info("Using " + type + " no-arg constructor");
if (log.isDebugEnabled()) log.debug("Using " + type + " no-arg constructor");
return new StateBackedCreator<T, STATE>() {
public T create(STATE state, Class<T> c) throws Exception {

View File

@@ -42,7 +42,7 @@ public class NodeEntityState extends DefaultEntityState<Node> {
@Override
public void createAndAssignState() {
if (hasPersistentState()) {
if (log.isInfoEnabled()) log.info("Entity "+entity.getClass()+" already has persistent state "+getPersistentState());
if (log.isDebugEnabled()) log.debug("Entity "+entity.getClass()+" already has persistent state "+getPersistentState());
return;
}
try {
@@ -50,14 +50,14 @@ public class NodeEntityState extends DefaultEntityState<Node> {
if (id instanceof Number) {
final Node node = template.getNode(((Number) id).longValue());
setPersistentState(node);
if (log.isInfoEnabled())
log.info("Entity reattached " + entity.getClass() + "; used Node [" + getPersistentState() + "];");
if (log.isDebugEnabled())
log.debug("Entity reattached " + entity.getClass() + "; used Node [" + getPersistentState() + "];");
return;
}
final Node node = persistentEntity.isUnique() ? template.createUniqueNode(entity) : template.createNode();
setPersistentState(node);
if (log.isInfoEnabled()) log.info("User-defined constructor called on class " + entity.getClass() + "; created Node [" + getPersistentState() + "]; Updating metamodel");
if (log.isDebugEnabled()) log.debug("User-defined constructor called on class " + entity.getClass() + "; created Node [" + getPersistentState() + "]; Updating metamodel");
template.postEntityCreation(node, type);
} catch (NotInTransactionException e) {
throw new InvalidDataAccessResourceUsageException("Not in a Neo4j transaction.", e);

View File

@@ -56,13 +56,13 @@ public class RelationshipEntityState extends DefaultEntityState<Relationship> {
if (id instanceof Number) {
final Relationship relationship = template.getRelationship(((Number) id).longValue());
setPersistentState(relationship);
if (log.isInfoEnabled())
log.info("Entity reattached " + entity.getClass() + "; used Relationship [" + state + "];");
if (log.isDebugEnabled())
log.debug("Entity reattached " + entity.getClass() + "; used Relationship [" + state + "];");
return;
}
final Relationship relationship = createRelationshipFromEntity();
setPersistentState(relationship);
if (log.isInfoEnabled()) log.info("User-defined constructor called on class " + entity.getClass() + "; created Relationship [" + getPersistentState() + "]; Updating metamodel");
if (log.isDebugEnabled()) log.debug("User-defined constructor called on class " + entity.getClass() + "; created Relationship [" + getPersistentState() + "]; Updating metamodel");
template.postEntityCreation(relationship, type);
} catch (NotInTransactionException e) {
throw new InvalidDataAccessResourceUsageException("Not in a Neo4j transaction.", e);