aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/bugdir.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@tremily.us>2013-01-24 02:31:52 -0500
committerW. Trevor King <wking@tremily.us>2013-01-24 02:36:22 -0500
commit932679f1e82a57feb4743e52d6c60f7331f057c2 (patch)
tree21c014cf36c8c159b7e5bf4627abf94b2e7a371b /libbe/bugdir.py
parent182a556397c2b0f4638991942c736c5daff17111 (diff)
downloadbugseverywhere-932679f1e82a57feb4743e52d6c60f7331f057c2.tar.gz
Transition to libbe.LOG for logging
This makes it easier to tweak log verbosity and redirect logs to other handlers. For example, the WSGI servers are unstable with stderr closed, and crash with an IOError if they try to print a warning to stderr.
Diffstat (limited to 'libbe/bugdir.py')
-rw-r--r--libbe/bugdir.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/libbe/bugdir.py b/libbe/bugdir.py
index 40097f7..8b9e1e7 100644
--- a/libbe/bugdir.py
+++ b/libbe/bugdir.py
@@ -396,7 +396,7 @@ class BugDir (list, settings_object.SavedSettingsObject):
sep = '\n' + istring
return istring + sep.join(lines).rstrip('\n')
- def from_xml(self, xml_string, preserve_uuids=False, verbose=True):
+ def from_xml(self, xml_string, preserve_uuids=False):
"""
Note: If a bugdir uuid is given, set .alt_id to it's value.
>>> bug.load_severities(bug.severity_def)
@@ -457,8 +457,7 @@ class BugDir (list, settings_object.SavedSettingsObject):
pass
elif child.tag == 'bug':
bg = bug.Bug(bugdir=self)
- bg.from_xml(
- child, preserve_uuids=preserve_uuids, verbose=verbose)
+ bg.from_xml(child, preserve_uuids=preserve_uuids)
self.append(bg, update=True)
continue
elif child.tag in tags:
@@ -513,8 +512,9 @@ class BugDir (list, settings_object.SavedSettingsObject):
attr_name = child.tag.replace('-','_')
self.explicit_attrs.append(attr_name)
setattr(self, attr_name, text)
- elif verbose == True:
- sys.stderr.write('Ignoring unknown tag {} in {}\n'.format(
+ else:
+ libbe.LOG.warning(
+ 'ignoring unknown tag {0} in {1}'.format(
child.tag, bugdir.tag))
if uuid != self.uuid:
if not hasattr(self, 'alt_id') or self.alt_id == None: