Changeset 4884
- Timestamp:
- 23 Jan 2010, 18:01:03 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/trunk/src/waeup/app.py
r4874 r4884 6 6 from zope.component import createObject 7 7 8 from waeup.interfaces import IUniversity, ICSVDataReceivers 8 from waeup.interfaces import (IUniversity, ICSVDataReceivers, IDataCenter, 9 IDataCenterStorageMovedEvent) 9 10 from waeup.authentication import setup_authentication 10 11 from waeup.datacenter import DataCenter … … 65 66 logger.addHandler(handler) 66 67 return logger 68 69 @grok.subscribe(IDataCenter, IDataCenterStorageMovedEvent) 70 def handle_storage_move(obj, event): 71 """Event handler, in case datacenter storage moves. 72 73 We initialize the application log again, then. 74 """ 75 app = grok.getSite() 76 if app is None: 77 return 78 if obj is not app['datacenter']: 79 return 80 logger = app.logger 81 logger.warn('Log Dir moved. Closing.') 82 handlers = logger.handlers 83 for handler in handlers: 84 logger.removeHandler(handler) 85 app._setupLogger(logger) 86 logger.warn('Log file moved. Opening.')
Note: See TracChangeset for help on using the changeset viewer.