示例#1
0
 def __init__(self, logChannel=None, bindObject=None):
     logChannelName = self.GetLogChannelName(logChannel, bindObject)
     self.__logname__ = self.GetLogName(logChannelName)
     self.logChannel = logmodule.GetChannel(logChannelName)
     self.LoadPrefs()
     self.logContexts = {}
     for each in ('Info', 'Notice', 'Warn', 'Error'):
         self.logContexts[each] = 'Logging::' + each
示例#2
0
 def __init__(self, logChannel=None, bindObject=None):
     """
         Parameters:
             - logChannelName should be a string, which is usually (but not always)
             the guid of the service/object that is deriving from the mixin.
             - bindObject is an object which already has a logserver channel defined
             If provided this object will link it's logserver calls to the same channel as the other object.
             (This functionality seemed to be a hack in some places, but in others I am fairly certain it was deliberate)
         Parameter Restrictions:
             - logChannelName should be a string or None.  No other types accepted.
             - bindObject should be an object which has the member variable (__guid__ or __logname__) defined.
             - You can ONLY provide one or the other.  If you provide both, an exception will be thrown.
                 You shouldn't be trying to log to two channels at once, each of these parameters are
                 meant for deciding which channel to log on.  Providing two separate channels is a conflict.
     """
     logChannelName = self.GetLogChannelName(logChannel, bindObject)
     self.__logname__ = self.GetLogName(logChannelName)
     self.logChannel = logmodule.GetChannel(logChannelName)
     self.LoadPrefs()
     self.logContexts = {}
     for each in ('Info', 'Notice', 'Warn', 'Error'):
         self.logContexts[each] = 'Logging::' + each
示例#3
0
 def __init__(self):
     self.name = 'exefile{}'.format(os.getpid())
     super(ClientBootManager, self).__init__(self.size, self.name)
     logmodule.GetChannel('sharedMemory')
     self.log = logmodule.GetChannel('sharedMemory').Log
示例#4
0
#Embedded file name: e:\jenkins\workspace\client_SERENITY\branches\release\SERENITY\packages\localization\logger.py
import logmodule
LOG_TRACEBACKS = True
logChannel = logmodule.GetChannel('Localization')


def LogInfo(*args):
    logChannel.Log('Localization module: ' + ''.join(map(strx, args)),
                   logChannel.flags['INFO'])


def LogWarn(*args):
    logChannel.Log('Localization module: ' + ''.join(map(strx, args)),
                   logChannel.flags['WARN'])


def LogError(*args):
    logChannel.Log('Localization module: ' + ''.join(map(strx, args)),
                   logChannel.flags['ERR'])


def LogTraceback(*args):
    logChannel.Log('Localization module: ' + ''.join(map(strx, args)),
                   logChannel.flags['ERR'])
    if LOG_TRACEBACKS:
        logmodule.LogTraceback('Localization module: ' +
                               ''.join(map(strx, args)),
                               channel='Localization',
                               toConsole=0,
                               toAlertSvc=0,
                               severity=1,