Commit d501c068 authored by Nicolas Dumazet's avatar Nicolas Dumazet

refine logging to avoid being pedantic when installing Sites.

I need some way to distinguish what happens when, later, an automatic migration
happens, or when a Tool is not found: if this happens in a "normal" context,
then logging should be very loud and verbose, as this is likely to crash your
site.
On the other hand, during bootstrap/setup, this is perfectly normal to miss
some tools/modules, and we should not worry/log about it, or the NECESSARY
logs will be quickly removed by developers tired of seeing "useless" logs...

Better ideas that can work in a fresh site without workflows, portal types,
or any advanced mechanism? I'm all ears.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42877 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8ac35fd7
...@@ -1561,6 +1561,13 @@ class ERP5Generator(PortalGenerator): ...@@ -1561,6 +1561,13 @@ class ERP5Generator(PortalGenerator):
# Make sure reindex will not be called until business templates # Make sure reindex will not be called until business templates
# will be installed # will be installed
setattr(portal, 'isIndexable', ConstantGetter('isIndexable', value=False)) setattr(portal, 'isIndexable', ConstantGetter('isIndexable', value=False))
# This is only used to refine log level.
# Has no functional use, and should never have any:
# if you use it for something else than a logging-oriented hint,
# trolls *will* chase you and haunt you in your dreams
portal._v_bootstrapping = True
parent._setObject(id, portal) parent._setObject(id, portal)
# Return the fully wrapped object. # Return the fully wrapped object.
p = parent.this()._getOb(id) p = parent.this()._getOb(id)
...@@ -1583,6 +1590,9 @@ class ERP5Generator(PortalGenerator): ...@@ -1583,6 +1590,9 @@ class ERP5Generator(PortalGenerator):
p._setProperty('management_page_charset', 'UTF-8', 'string') p._setProperty('management_page_charset', 'UTF-8', 'string')
self.setup(p, create_userfolder, create_activities=create_activities, self.setup(p, create_userfolder, create_activities=create_activities,
reindex=reindex, **kw) reindex=reindex, **kw)
p._v_bootstrapping = False
return p return p
def setupLastTools(self, p, create_activities=True, **kw): def setupLastTools(self, p, create_activities=True, **kw):
......
...@@ -239,6 +239,7 @@ def generatePortalTypeClass(site, portal_type_name): ...@@ -239,6 +239,7 @@ def generatePortalTypeClass(site, portal_type_name):
# The Property Sheet Tool may be None if the code is updated but # The Property Sheet Tool may be None if the code is updated but
# the BT has not been upgraded yet with portal_property_sheets # the BT has not been upgraded yet with portal_property_sheets
if property_sheet_tool is None: if property_sheet_tool is None:
if not getattr(site, '_v_bootstrapping', False):
LOG("ERP5Type.dynamic", WARNING, LOG("ERP5Type.dynamic", WARNING,
"Property Sheet Tool was not found. Please update erp5_core " "Property Sheet Tool was not found. Please update erp5_core "
"Business Template") "Business Template")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment