1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-01-10 01:17:59 +03:00

* added log capability to deployed user services implementations

* Added log when service is restrained
This commit is contained in:
Adolfo Gómez 2013-03-05 18:14:59 +00:00
parent 56f4db54dd
commit dd45014231
2 changed files with 9 additions and 0 deletions

View File

@ -211,6 +211,13 @@ class UserDeployment(Environmentable, Serializable):
'''
return self._dbService
def doLog(self, level, message):
'''
Logs a message with requested level associated with this service
'''
from uds.core.util import log
log.doLog(self._dbService, level, message, log.SERVICE)
def macGenerator(self):
'''
Utility method to access provided macs generator (inside environment)

View File

@ -39,6 +39,7 @@ from uds.core.managers.UserServiceManager import UserServiceManager
from uds.core.services.Exceptions import MaxServicesReachedException
from uds.models import DeployedService
from uds.core import services
from uds.core.util import log
from uds.core.jobs.Job import Job
import logging
@ -87,6 +88,7 @@ class ServiceCacheUpdater(Job):
continue
if ds.isRestrained():
log.doLog(ds, log.ERROR, 'Deployed service is restrained due to errors', log.INTERNAL)
logger.info('Deployed service {0} is restrained, will check this later'.format(ds.name))
continue