1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-22 13:34:04 +03:00

Fixed log so source is better described.

This commit is contained in:
Adolfo Gómez 2013-01-10 16:37:44 +00:00
parent 59b4f27ca7
commit 462cfe9391
2 changed files with 5 additions and 5 deletions

View File

@ -39,7 +39,7 @@ useLogger = logging.getLogger('useLog')
OTHER,DEBUG,INFO,WARN,ERROR,FATAL = (10000*(x+1) for x in xrange(6))
# Logging sources
INTERNAL,ACTOR,TRANSPORT = ('internal', 'actor', 'transport')
INTERNAL,ACTOR,TRANSPORT, OSMANAGER = ('internal', 'actor', 'transport', 'osmanager')
OTHERSTR,DEBUGSTR,INFOSTR,WARNSTR,ERRORSTR,FATALSTR = ('OTHER', 'DEBUG', 'INFO', 'WARN', 'ERROR', 'FATAL')

View File

@ -86,13 +86,13 @@ class WindowsOsManager(osmanagers.OSManager):
si.setIp(val)
break
def doLog(self, service, data):
def doLog(self, service, data, origin = log.OSMANAGER):
# Stores a log associated with this service
try:
msg, level = data.split('\t')
service.doLog(level, msg, log.ACTOR)
service.doLog(level, msg, origin)
except:
service.doLog(log.ERROR, "do not understand {0}".format(data), log.ACTOR)
service.doLog(log.ERROR, "do not understand {0}".format(data), log.TRANSPORT)
def process(self,service,msg, data):
@ -118,7 +118,7 @@ class WindowsOsManager(osmanagers.OSManager):
ret = self.infoValue(service)
state = State.PREPARING
elif msg == "log":
self.doLog(service, data)
self.doLog(service, data, log.ACTOR)
elif msg == "logon":
si = service.getInstance()
si.userLoggedIn(data)