From: W. Trevor King Date: Thu, 10 Mar 2011 13:59:52 +0000 (-0500) Subject: Add pypiezo.LOG to allow easy logging. X-Git-Tag: 0.5~17 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e0062030d586d606bba8b88f8e18d8feffdaba86;p=pypiezo.git Add pypiezo.LOG to allow easy logging. --- 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