diff MoinMoin/events/__init__.py @ 2323:a43db0817020

Use stdlib's logging instead of prints.
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Sat, 23 Jun 2007 21:15:18 +0200
parents 062b76cf8d48
children 9a71ea0c941b
line wrap: on
line diff
--- a/MoinMoin/events/__init__.py	Sat Jun 23 21:02:15 2007 +0200
+++ b/MoinMoin/events/__init__.py	Sat Jun 23 21:15:18 2007 +0200
@@ -9,6 +9,8 @@
     @license: GNU GPL, see COPYING for details.
 """
 
+import logging
+
 from MoinMoin import wikiutil
 from MoinMoin.util import pysupport
 from MoinMoin.wikiutil import PluginAttributeError
@@ -16,6 +18,12 @@
 # Create a list of extension actions from the package directory
 modules = pysupport.getPackageModules(__file__)
 
+# A module-wide Logger, don't use it from outside
+logger = logging.getLogger("events")
+logger.setLevel(logging.DEBUG)
+logger.addHandler(logging.StreamHandler())
+
+
 class Event(object):
     """A class handling information common to all events."""
     def __init__(self, request):