From 608aca8e65fc790cda72e1e018cbd1da601d854c Mon Sep 17 00:00:00 2001 From: John Ralls Date: Thu, 20 Feb 2014 13:42:38 -0800 Subject: [PATCH] Fix up grampslocale logging a bit. Send log messages "up the chain", make maclocale a sub-log of grampslocale. --- gramps/gen/utils/grampslocale.py | 4 ++-- gramps/gen/utils/maclocale.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gramps/gen/utils/grampslocale.py b/gramps/gen/utils/grampslocale.py index 3c463b4fe..fbc02608d 100644 --- a/gramps/gen/utils/grampslocale.py +++ b/gramps/gen/utils/grampslocale.py @@ -34,7 +34,7 @@ import codecs import locale import logging LOG = logging.getLogger("." + __name__) -LOG.addHandler(logging.NullHandler()) +LOG.propagate = True HAVE_ICU = False _hdlr = None # GrampsLocale initialization comes before command-line argument @@ -549,7 +549,7 @@ class GrampsLocale(object): if _hdlr: LOG.removeHandler(_hdlr) - + _hdlr = None self._dd = self._dp = None #Guards against running twice on the first instance. self.initialized = True diff --git a/gramps/gen/utils/maclocale.py b/gramps/gen/utils/maclocale.py index a9ad9c950..3fc5829d0 100644 --- a/gramps/gen/utils/maclocale.py +++ b/gramps/gen/utils/maclocale.py @@ -79,7 +79,9 @@ locale, leaving $LANGUAGE unset (which is the same as setting it to import sys, os, subprocess, locale import logging -LOG = logging.getLogger("grampslocale") +LOG = logging.getLogger(".gramps.gen.utils.grampslocale.mac") +LOG.propagate = True +#LOG.setLevel(logging.DEBUG) def mac_setup_localization(glocale): """