From e0062030d586d606bba8b88f8e18d8feffdaba86 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 10 Mar 2011 08:59:52 -0500 Subject: [PATCH] Add pypiezo.LOG to allow easy logging. --- pypiezo/__init__.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pypiezo/__init__.py b/pypiezo/__init__.py index 3d079a0..38b75af 100644 --- a/pypiezo/__init__.py +++ b/pypiezo/__init__.py @@ -15,4 +15,20 @@ # You should have received a copy of the GNU General Public License # along with pypiezo. If not, see . +import logging as _logging + + __version__ = '0.4' + + +LOG = _logging.getLogger('pypiezo') +"Pypiezo logger" + +LOG.setLevel(_logging.DEBUG) +h = _logging.StreamHandler() +#h.setLevel(_logging.WARN) +h.setLevel(_logging.DEBUG) +f = _logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") +h.setFormatter(f) +LOG.addHandler(h) +del h, f -- 2.26.2