Changeset 6481 for main/waeup.sirp/trunk
- Timestamp:
- 27 Jun 2011, 10:31:10 (14 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/root.py
r6478 r6481 27 27 from hurry.query.interfaces import IQuery 28 28 from zope.component import getUtility 29 from waeup.sirp.interfaces import IWAeUPSIRPPluggable 30 from waeup.sirp.utils.logger import ISiteLoggers 29 from waeup.sirp.interfaces import IWAeUPSIRPPluggable, ISiteLoggers 31 30 from waeup.sirp.applicants.interfaces import IApplicantsRoot 32 31 from waeup.sirp.utils.helpers import get_current_principal … … 59 58 else: 60 59 user = user.id 61 self.logger.info('%s - %s - %s - %s' % (user, target, ob_class, comment)) 60 self.logger.info('%s - %s - %s - %s' % ( 61 user, target, ob_class, comment)) 62 62 63 63 class ApplicantsPlugin(grok.GlobalUtility): -
main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py
r6361 r6481 448 448 """ 449 449 pass 450 451 class ISiteLoggers(Interface): 452 453 loggers = Attribute("A list or generator of registered WAeUPLoggers") 454 455 def register(name, filename=None, site=None, **options): 456 """Register a logger `name` which logs to `filename`. 457 458 If `filename` is not given, logfile will be `name` with 459 ``.log`` as filename extension. 460 """ 461 462 def unregister(name): 463 """Unregister a once registered logger. 464 """ 465 466 class ILogger(Interface): 467 """A logger cares for setup, update and restarting of a Python logger. 468 """ 469 470 logger = Attribute("""A :class:`logging.Logger` instance""") 471 472 473 def __init__(name, filename=None, site=None, **options): 474 """Create a WAeUP logger instance. 475 """ 476 pass 477 478 def setup(): 479 """Create a Python :class:`logging.Logger` instance. 480 481 The created logger is based on the params given by constructor. 482 """ 483 pass 484 485 def update(**options): 486 """Update the logger. 487 488 Updates the logger respecting modified `options` and changed 489 paths. 490 """ 491 -
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.