[debug] improve debug messages

authorNicolas Chauvat <nicolas.chauvat@logilab.fr>
changeseta5e22657f6f4
branchstable
phasepublic
hiddenno
parent revision#b5f15098f282 [debug] when a loop is detected in a tree, log the entity involved in it to ease repair
child revision#0eabedcfb0a9 [security] do not show sessions information to non managers users. Close security ticket #38246
files modified by this revision
cwvreg.py
vregistry.py
# HG changeset patch
# User Nicolas Chauvat <nicolas.chauvat@logilab.fr>
# Date 1280149487 -7200
# Mon Jul 26 15:04:47 2010 +0200
# Branch stable
# Node ID a5e22657f6f44d31582431ea8718c3767dc5c155
# Parent b5f15098f282216cb91a5c507c0dc49e074a7eae
[debug] improve debug messages

diff --git a/cwvreg.py b/cwvreg.py
@@ -614,27 +614,27 @@
1                                     and iface in self.schema
2                                     and self['etypes'].etype_class(iface)
3                                     or iface
4                                     for iface in ifaces)
5                  if not ('Any' in ifaces or ifaces & implemented_interfaces):
6 -                    self.debug('kicking appobject %s (no implemented '
7 +                    self.debug('unregister %s (no implemented '
8                                 'interface among %s)', obj, ifaces)
9                      self.unregister(obj)
10              # since 3.9: remove appobjects which depending on other, unexistant
11              # appobjects
12              for obj, (regname, regids) in self._needs_appobject.items():
13                  try:
14                      registry = self[regname]
15                  except RegistryNotFound:
16 -                    self.debug('kicking %s (no registry %s)', obj, regname)
17 +                    self.debug('unregister %s (no registry %s)', obj, regname)
18                      self.unregister(obj)
19                      continue
20                  for regid in regids:
21                      if registry.get(regid):
22                          break
23                  else:
24 -                    self.debug('kicking %s (no %s object in registry %s)',
25 +                    self.debug('unregister %s (no %s object in registry %s)',
26                                 obj, ' or '.join(regids), regname)
27                      self.unregister(obj)
28          super(CubicWebVRegistry, self).initialization_completed()
29          for rtag in RTAGS:
30              # don't check rtags if we don't want to cleanup_interface_sobjects
diff --git a/vregistry.py b/vregistry.py
@@ -370,11 +370,11 @@
31              # XXX may occurs?
32              vname = obj.__class__.__name__
33          for registryname in class_registries(obj, registryname):
34              registry = self.setdefault(registryname)
35              registry.register(obj, oid=oid, clear=clear)
36 -            self.debug('registered appobject %s in registry %s with id %s',
37 +            self.debug('register %s in %s[\'%s\']',
38                         vname, registryname, oid or class_regid(obj))
39          self._loadedmods.setdefault(obj.__module__, {})[classid(obj)] = obj
40 
41      def unregister(self, obj, registryname=None):
42          """unregister `obj` application object from the registry `registryname` or