Clean up some logging calls when recording instance changes.
This commit is contained in:
parent
b8333e822c
commit
0b03551a58
|
@ -93,10 +93,10 @@ class ChangeRecorder(object):
|
|||
versioning_manager.before_flush(session, flush_context, instances)
|
||||
|
||||
for instance in session.deleted:
|
||||
log.debug("ChangeRecorder: found deleted instance: {0}".format(repr(instance)))
|
||||
log.debug("found deleted instance: {0}".format(repr(instance)))
|
||||
self.record_change(session, instance, deleted=True)
|
||||
for instance in session.new:
|
||||
log.debug("ChangeRecorder: found new instance: {0}".format(repr(instance)))
|
||||
log.debug("found new instance: {0}".format(repr(instance)))
|
||||
self.record_change(session, instance)
|
||||
for instance in session.dirty:
|
||||
if session.is_modified(instance, passive=True):
|
||||
|
@ -104,10 +104,10 @@ class ChangeRecorder(object):
|
|||
# session.dirty instead of session.deleted, hence this check.
|
||||
# See also https://groups.google.com/d/msg/sqlalchemy/H4nQTHphc0M/Xr8-Cgra0Z4J
|
||||
if self.is_deletable_orphan(instance):
|
||||
log.debug("ChangeRecorder: found orphan pending deletion: {0}".format(repr(instance)))
|
||||
log.debug("found orphan pending deletion: {0}".format(repr(instance)))
|
||||
self.record_change(session, instance, deleted=True)
|
||||
else:
|
||||
log.debug("ChangeRecorder: found dirty instance: {0}".format(repr(instance)))
|
||||
log.debug("found dirty instance: {0}".format(repr(instance)))
|
||||
self.record_change(session, instance)
|
||||
|
||||
def is_deletable_orphan(self, instance):
|
||||
|
@ -215,7 +215,7 @@ class ChangeRecorder(object):
|
|||
return
|
||||
|
||||
instance.uuid = get_uuid()
|
||||
log.error("ChangeRecorder.ensure_uuid: unexpected scenario; generated new UUID for instance: {0}".format(repr(instance)))
|
||||
log.error("unexpected scenario; generated new UUID for instance: {0}".format(repr(instance)))
|
||||
|
||||
|
||||
class ChangeRecorderExtension(SessionExtension): # pragma: no cover
|
||||
|
|
Loading…
Reference in a new issue