Changeset 6481 for main/waeup.sirp/trunk/src/waeup/sirp/utils
- Timestamp:
- 27 Jun 2011, 10:31:10 (14 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/utils
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/utils/logger.py
r6480 r6481 27 27 import logging 28 28 from zope.interface import Interface, Attribute 29 30 class ISiteLoggers(Interface): 31 32 loggers = Attribute("A list or generator of registered WAeUPLoggers") 33 34 def register(name, filename=None, site=None, **options): 35 """Register a logger `name` which logs to `filename`. 36 37 If `filename` is not given, logfile will be `name` with 38 ``.log`` as filename extension. 39 """ 40 41 def unregister(name): 42 """Unregister a once registered logger. 43 """ 29 from waeup.sirp.interfaces import ISiteLoggers, ILogger 44 30 45 31 class SiteLoggers(object): … … 72 58 def keys(self): 73 59 return self._loggers.keys() 74 75 class ILogger(Interface):76 """A logger cares for setup, update and restarting of a Python logger.77 """78 79 logger = Attribute("""A :class:`logging.Logger` instance""")80 81 82 def __init__(name, filename=None, site=None, **options):83 """Create a WAeUP logger instance.84 """85 pass86 87 def setup():88 """Create a Python :class:`logging.Logger` instance.89 90 The created logger is based on the params given by constructor.91 """92 pass93 94 def update(**options):95 """Update the logger.96 97 Updates the logger respecting modified `options` and changed98 paths.99 """100 60 101 61 class WAeUPLogger(object): -
main/waeup.sirp/trunk/src/waeup/sirp/utils/tests/test_logger.py
r6440 r6481 30 30 from zope.interface.verify import verifyClass, verifyObject 31 31 from waeup.sirp.app import University 32 from waeup.sirp.interfaces import ISiteLoggers, ILogger 32 33 from waeup.sirp.testing import FunctionalLayer, doctestsuite_for_module 33 34 from waeup.sirp.utils.logger import ( 34 ISiteLoggers, ILogger,SiteLoggers, WAeUPLogger, SiteLoggersRepository)35 SiteLoggers, WAeUPLogger, SiteLoggersRepository) 35 36 36 37 class SiteLoggersTests(FunctionalTestCase):
Note: See TracChangeset for help on using the changeset viewer.