Better logging.

This commit is contained in:
Jeremy Fincher 2004-11-21 13:31:50 +00:00
parent de367731f1
commit fd4e62599f

View File

@ -111,11 +111,16 @@ def close(registry, filename, private=True):
if hasattr(value, 'value'): if hasattr(value, 'value'):
if value._showDefault: if value._showDefault:
lines.append('#\n') lines.append('#\n')
try:
x = value.__class__(value._default, value._help) x = value.__class__(value._default, value._help)
except Exception, e:
exception('Exception instantiating default for %s:',
value._name)
try: try:
lines.append('# Default value: %s\n' % x) lines.append('# Default value: %s\n' % x)
except Exception, e: except Exception, e:
exception('Exception printing default value:') exception('Exception printing default value of %s:',
value._name)
lines.append('###\n') lines.append('###\n')
fd.writelines(lines) fd.writelines(lines)
if hasattr(value, 'value'): # This lets us print help for non-valued. if hasattr(value, 'value'): # This lets us print help for non-valued.