From b5934e134e09d3547aca86b1bfef694e8f88505e Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sun, 5 Mar 2006 04:45:44 +0000 Subject: [PATCH] logging support svn: r6081 --- gramps2/src/Assistant.py | 8 ++++++++ gramps2/src/AutoComp.py | 8 ++++++++ gramps2/src/BaseDoc.py | 8 ++++++++ gramps2/src/Bookmarks.py | 8 ++++++++ gramps2/src/ColumnOrder.py | 8 ++++++++ gramps2/src/DateDisplay.py | 24 ++++++++++++++++++++++++ gramps2/src/DateEdit.py | 8 ++++++++ gramps2/src/DateHandler.py | 8 ++++++++ gramps2/src/DateParser.py | 8 ++++++++ gramps2/src/DdTargets.py | 9 +++++++++ gramps2/src/DisplayModels.py | 1 + gramps2/src/DisplayState.py | 15 ++++++++------- gramps2/src/DisplayTabs.py | 8 ++++++++ gramps2/src/Exporter.py | 8 ++++++++ gramps2/src/GenericFilter.py | 8 ++++++++ gramps2/src/PeopleModel.py | 9 ++++++++- gramps2/src/ViewManager.py | 6 ++++++ 17 files changed, 144 insertions(+), 8 deletions(-) diff --git a/gramps2/src/Assistant.py b/gramps2/src/Assistant.py index d81523d7d..7d08a1107 100644 --- a/gramps2/src/Assistant.py +++ b/gramps2/src/Assistant.py @@ -28,6 +28,14 @@ from gettext import gettext as _ import os +#------------------------------------------------------------------------- +# +# set up logging +# +#------------------------------------------------------------------------- +import logging +log = logging.getLogger(".Assistant") + #------------------------------------------------------------------------- # # GTK modules diff --git a/gramps2/src/AutoComp.py b/gramps2/src/AutoComp.py index 2225df611..64e8271b4 100644 --- a/gramps2/src/AutoComp.py +++ b/gramps2/src/AutoComp.py @@ -27,6 +27,14 @@ #------------------------------------------------------------------------- import locale +#------------------------------------------------------------------------- +# +# set up logging +# +#------------------------------------------------------------------------- +import logging +log = logging.getLogger(".AutoComp") + #------------------------------------------------------------------------- # # GNOME modules diff --git a/gramps2/src/BaseDoc.py b/gramps2/src/BaseDoc.py index f7c6dc2ee..313980d49 100644 --- a/gramps2/src/BaseDoc.py +++ b/gramps2/src/BaseDoc.py @@ -76,6 +76,14 @@ from math import pi, cos, sin import Utils import FontScale +#------------------------------------------------------------------------- +# +# set up logging +# +#------------------------------------------------------------------------- +import logging +log = logging.getLogger(".BaseDoc") + #------------------------------------------------------------------------- # # SAX interface diff --git a/gramps2/src/Bookmarks.py b/gramps2/src/Bookmarks.py index 4ebe5e685..6acc48fae 100644 --- a/gramps2/src/Bookmarks.py +++ b/gramps2/src/Bookmarks.py @@ -33,6 +33,14 @@ __version__ = "$Revision$" from gettext import gettext as _ from cStringIO import StringIO +#------------------------------------------------------------------------- +# +# set up logging +# +#------------------------------------------------------------------------- +import logging +log = logging.getLogger(".Bookmarks") + #------------------------------------------------------------------------- # # GTK/Gnome modules diff --git a/gramps2/src/ColumnOrder.py b/gramps2/src/ColumnOrder.py index 8920c1879..a168d148d 100644 --- a/gramps2/src/ColumnOrder.py +++ b/gramps2/src/ColumnOrder.py @@ -31,6 +31,14 @@ import gc import const from gettext import gettext as _ +#------------------------------------------------------------------------- +# +# set up logging +# +#------------------------------------------------------------------------- +import logging +log = logging.getLogger(".ColumnOrder") + class ColumnOrder: def __init__(self,arglist,column_names,callback): diff --git a/gramps2/src/DateDisplay.py b/gramps2/src/DateDisplay.py index 1a669e2f8..e4cbe1325 100644 --- a/gramps2/src/DateDisplay.py +++ b/gramps2/src/DateDisplay.py @@ -28,10 +28,34 @@ localized tasks. __author__ = "Donald N. Allingham" __version__ = "$Revision$" +#------------------------------------------------------------------------- +# +# python modules +# +#------------------------------------------------------------------------- from gettext import gettext as _ + +#------------------------------------------------------------------------- +# +# set up logging +# +#------------------------------------------------------------------------- +import logging +log = logging.getLogger(".DateDisplay") + +#------------------------------------------------------------------------- +# +# GRAMPS modules +# +#------------------------------------------------------------------------- from RelLib import Date import GrampsLocale +#------------------------------------------------------------------------- +# +# DateDisplay +# +#------------------------------------------------------------------------- class DateDisplay: _months = GrampsLocale.long_months diff --git a/gramps2/src/DateEdit.py b/gramps2/src/DateEdit.py index 82a609b34..7b1d6df72 100644 --- a/gramps2/src/DateEdit.py +++ b/gramps2/src/DateEdit.py @@ -44,6 +44,14 @@ __version__ = "$Revision$" from gettext import gettext as _ import gc +#------------------------------------------------------------------------- +# +# set up logging +# +#------------------------------------------------------------------------- +import logging +log = logging.getLogger(".DateEdit") + #------------------------------------------------------------------------- # # GNOME modules diff --git a/gramps2/src/DateHandler.py b/gramps2/src/DateHandler.py index 653a924a0..ce1a23361 100644 --- a/gramps2/src/DateHandler.py +++ b/gramps2/src/DateHandler.py @@ -32,6 +32,14 @@ Class handling language-specific selection for date parser and displayer. import os import locale +#------------------------------------------------------------------------- +# +# set up logging +# +#------------------------------------------------------------------------- +import logging +log = logging.getLogger(".DateHandler") + #------------------------------------------------------------------------- # # GRAMPS modules diff --git a/gramps2/src/DateParser.py b/gramps2/src/DateParser.py index 694afa1c9..0a5f97cfe 100644 --- a/gramps2/src/DateParser.py +++ b/gramps2/src/DateParser.py @@ -37,6 +37,14 @@ __version__ = "$Revision$" import re import calendar +#------------------------------------------------------------------------- +# +# set up logging +# +#------------------------------------------------------------------------- +import logging +log = logging.getLogger(".DateParser") + #------------------------------------------------------------------------- # # GRAMPS modules diff --git a/gramps2/src/DdTargets.py b/gramps2/src/DdTargets.py index 09df3fd00..465f17ee0 100644 --- a/gramps2/src/DdTargets.py +++ b/gramps2/src/DdTargets.py @@ -46,6 +46,15 @@ """ +#------------------------------------------------------------------------- +# +# set up logging +# +#------------------------------------------------------------------------- +import logging +log = logging.getLogger(".DdTargets") + + class _DdType: """Represents the fields needed by a drag and drop traget.""" diff --git a/gramps2/src/DisplayModels.py b/gramps2/src/DisplayModels.py index 15ab9e1e3..38d7f0815 100644 --- a/gramps2/src/DisplayModels.py +++ b/gramps2/src/DisplayModels.py @@ -27,6 +27,7 @@ import time from gettext import gettext as _ import locale + import logging log = logging.getLogger(".") diff --git a/gramps2/src/DisplayState.py b/gramps2/src/DisplayState.py index 611f92b40..04e348858 100644 --- a/gramps2/src/DisplayState.py +++ b/gramps2/src/DisplayState.py @@ -27,6 +27,14 @@ #------------------------------------------------------------------------- from cStringIO import StringIO +#------------------------------------------------------------------------- +# +# set up logging +# +#------------------------------------------------------------------------- +import logging +log = logging.getLogger(".DisplayState") + #------------------------------------------------------------------------- # # GNOME python modules @@ -516,13 +524,6 @@ class ManagedWindow: """ self.window.present() -#------------------------------------------------------------------------- -# -# Gramps Display State class -# -#------------------------------------------------------------------------- - -import logging from GrampsLogger import RotateHandler class WarnHandler(RotateHandler): diff --git a/gramps2/src/DisplayTabs.py b/gramps2/src/DisplayTabs.py index 6ef586184..77e021508 100644 --- a/gramps2/src/DisplayTabs.py +++ b/gramps2/src/DisplayTabs.py @@ -43,6 +43,14 @@ except: from sets import Set as set print "set not used" +#------------------------------------------------------------------------- +# +# set up logging +# +#------------------------------------------------------------------------- +import logging +log = logging.getLogger(".DisplayTabs") + #------------------------------------------------------------------------- # # GRAMPS libraries diff --git a/gramps2/src/Exporter.py b/gramps2/src/Exporter.py index 5ecfe3f39..18896b9e7 100644 --- a/gramps2/src/Exporter.py +++ b/gramps2/src/Exporter.py @@ -30,6 +30,14 @@ import os from gettext import gettext as _ +#------------------------------------------------------------------------- +# +# set up logging +# +#------------------------------------------------------------------------- +import logging +log = logging.getLogger(".Exporter") + #------------------------------------------------------------------------- # # Gnome modules diff --git a/gramps2/src/GenericFilter.py b/gramps2/src/GenericFilter.py index b0b462930..54482ad83 100644 --- a/gramps2/src/GenericFilter.py +++ b/gramps2/src/GenericFilter.py @@ -40,6 +40,14 @@ import os import sets from gettext import gettext as _ +#------------------------------------------------------------------------- +# +# set up logging +# +#------------------------------------------------------------------------- +import logging +log = logging.getLogger(".GenericFilter") + #------------------------------------------------------------------------- # # gtk diff --git a/gramps2/src/PeopleModel.py b/gramps2/src/PeopleModel.py index aa3bf71f3..10eb227f7 100644 --- a/gramps2/src/PeopleModel.py +++ b/gramps2/src/PeopleModel.py @@ -37,6 +37,14 @@ try: except: from sets import Set as set +#------------------------------------------------------------------------- +# +# set up logging +# +#------------------------------------------------------------------------- +import logging +log = logging.getLogger(".") + #------------------------------------------------------------------------- # # GTK modules @@ -248,7 +256,6 @@ class PeopleModel(gtk.GenericTreeModel): self.prev_handle = node return COLUMN_DEFS[col][COLUMN_DEF_LIST](self,self.prev_data,node) except: - print "".join(traceback.format_exception(*sys.exc_info())) return u'error' def on_iter_next(self, node): diff --git a/gramps2/src/ViewManager.py b/gramps2/src/ViewManager.py index e61bae83d..149c46a7d 100644 --- a/gramps2/src/ViewManager.py +++ b/gramps2/src/ViewManager.py @@ -29,6 +29,12 @@ from gettext import gettext as _ from bsddb import db import os from cStringIO import StringIO + +#------------------------------------------------------------------------- +# +# set up logging +# +#------------------------------------------------------------------------- import logging log = logging.getLogger(".")