- Timestamp:
- 13 Nov 2014, 14:40:27 (10 years ago)
- Location:
- main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/utils/logger.py
r9988 r11949 19 19 Convenience stuff for logging. 20 20 21 Main component of :mod:`waeup. kofa.utils.logging` is a mix-in class22 :class:`waeup. kofa.utils.logging.Logger`. Classes derived (also) from21 Main component of :mod:`waeup.ikoba.utils.logging` is a mix-in class 22 :class:`waeup.ikoba.utils.logging.Logger`. Classes derived (also) from 23 23 that mix-in provide a `logger` attribute that returns a regular Python 24 24 logger logging to a rotating log file stored in the datacenter storage … … 30 30 The `logger_name` tells under which name the logger should be 31 31 registered Python-wise. This is usually a dotted name string like 32 ``waeup. kofa.${sitename}.mycomponent`` which should be unique. If you32 ``waeup.ikoba.${sitename}.mycomponent`` which should be unique. If you 33 33 pick a name already used by another component, trouble is ahead. The 34 34 ``${sitename}`` chunk of the name can be set literally like this. The … … 46 46 your `logger_name` and `logger_filename` attribute and off you go:: 47 47 48 from waeup. kofa.utils.logger import Logger48 from waeup.ikoba.utils.logger import Logger 49 49 50 50 class MyComponent(object, Logger): 51 51 # Yes that's a complete working class 52 logger_name = 'waeup. kofa.${sitename}.mycomponent52 logger_name = 'waeup.ikoba.${sitename}.mycomponent 53 53 logger_filename = 'mycomponent.log' 54 54 … … 67 67 68 68 The datacenter and its storage are created automatically when you 69 create a :class:`waeup. kofa.app.University`. This also means that69 create a :class:`waeup.ikoba.app.University`. This also means that 70 70 logging with the `Logger` mix-in will work only inside so-called sites 71 71 (`University` instances put into ZODB are such `sites`). … … 82 82 from zope.component import queryUtility 83 83 from zope.interface import Interface, Attribute, implements 84 from waeup. kofa.interfaces import (84 from waeup.ikoba.interfaces import ( 85 85 IDataCenter, IDataCenterStorageMovedEvent, ILoggerCollector) 86 from waeup. kofa.utils.helpers import get_current_principal86 from waeup.ikoba.utils.helpers import get_current_principal 87 87 88 88 #: Default logfile size (5 KB, not relevant for DatedRotatingFileHandlers) … … 154 154 155 155 #: The Python logger name used when 156 #: logging. ``'waeup. kofa.${sitename}'`` by default. You can use the156 #: logging. ``'waeup.ikoba.${sitename}'`` by default. You can use the 157 157 #: ``${sitename}`` placeholder in that string, which will be 158 158 #: replaced by the actual used site name. 159 logger_name = 'waeup. kofa.${sitename}'159 logger_name = 'waeup.ikoba.${sitename}' 160 160 161 161 #: The format to use when logging. … … 386 386 return 387 387 388 from waeup. kofa.interfaces import IUniversity388 from waeup.ikoba.interfaces import IUniversity 389 389 @grok.subscribe(IUniversity, grok.IObjectRemovedEvent) 390 390 def handle_site_removed(obj, event):
Note: See TracChangeset for help on using the changeset viewer.