当前位置: 首页>>代码示例>>Python>>正文


Python Log.getThreshold方法代码示例

本文整理汇总了Python中lsst.pex.logging.Log.getThreshold方法的典型用法代码示例。如果您正苦于以下问题:Python Log.getThreshold方法的具体用法?Python Log.getThreshold怎么用?Python Log.getThreshold使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lsst.pex.logging.Log的用法示例。


在下文中一共展示了Log.getThreshold方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: configurePipeline

# 需要导入模块: from lsst.pex.logging import Log [as 别名]
# 或者: from lsst.pex.logging.Log import getThreshold [as 别名]
    def configurePipeline(self):
        """
        Configure the Pipeline by reading a Policy File
        """

        if (self.executePolicy.exists('nSlices')):
            self.nSlices = self.executePolicy.getInt('nSlices')
        else:
            self.nSlices = 0   # default value
        self.universeSize = self.nSlices + 1; 

        if (self.executePolicy.exists('barrierDelay')):
            self.barrierDelay = self.executePolicy.getDouble('barrierDelay')
        else:
            self.barrierDelay = 0.000001   # default value

        # do some juggling to capture the actual stage policy names.  We'll
        # use these to assign some logical names to the stages for logging
        # purposes.  Note, however, that it is only convention that the
        # stage policies will be specified as separate files; thus, we need
        # a fallback.  
        stgcfg = self.executePolicy.getArray("appStage")
        self.stageNames = []
        for subpol in stgcfg:
            stageName = subpol.get("name") 
            self.stageNames.append(stageName)

        self.executePolicy.loadPolicyFiles()


        # Obtain the working directory space locators
        psLookup = lsst.daf.base.PropertySet()
        if (self.executePolicy.exists('dir')):
            dirPolicy = self.executePolicy.get('dir')
            shortName = None
            if (dirPolicy.exists('shortName')):
                shortName = dirPolicy.get('shortName')
            if shortName == None:
                shortName = self.pipelinePolicyName.split('.')[0]
            dirs = Directories(dirPolicy, shortName, self._runId)
            psLookup = dirs.getDirs()
        if (self.executePolicy.exists('database.url')):
            psLookup.set('dbUrl', self.executePolicy.get('database.url'))


        log = Log(self.log, "configurePipeline")
        log.log(Log.INFO,
                "Logging messages using threshold=%i" % log.getThreshold())
        LogRec(log, self.VERB1) << "Configuring pipeline"        \
                                << Prop("universeSize", self.universeSize) \
                                << Prop("runID", self._runId) \
                                << Prop("rank", -1)   \
                                << Prop("workerId", self.workerId) \
                                << LogRec.endr;
        

        # Configure persistence logical location map with values for directory 
        # work space locators
        dafPersist.LogicalLocation.setLocationMap(psLookup)

        log.log(self.VERB2, "eventBrokerHost %s " % self.eventBrokerHost)
        log.log(self.VERB2, "barrierDelay %s " % self.barrierDelay)

        # Check for eventTimeout
        if (self.executePolicy.exists('eventTimeout')):
            self.eventTimeout = self.executePolicy.getInt('eventTimeout')
        else:
            self.eventTimeout = 10000000   # default value is 10 000 000

        # Process Application Stages
        fullStageList = self.executePolicy.getArray("appStage")
        self.nStages = len(fullStageList)
        log.log(self.VERB2, "Found %d stages" % len(fullStageList))

        fullStageNameList = [ ]
        self.stagePolicyList = [ ]
        for stagei in xrange(self.nStages):
            fullStagePolicy = fullStageList[stagei]
            if (fullStagePolicy.exists('serialClass')):
                serialName = fullStagePolicy.getString('serialClass')
                stagePolicy = fullStagePolicy.get('stagePolicy') 
            else:
                serialName = "lsst.pex.harness.stage.NoOpSerialProcessing"
                stagePolicy = None

            fullStageNameList.append(serialName)
            self.stagePolicyList.append(stagePolicy)

            if self.stageNames[stagei] is None:
                self.stageNames[stagei] = fullStageNameList[-1].split('.')[-1]
            log.log(self.VERB3,
                    "Stage %d: %s: %s" % (stagei+1, self.stageNames[stagei],
                                          fullStageNameList[-1]))
        for astage in fullStageNameList:
            fullStage = astage.strip()
            tokenList = astage.split('.')
            classString = tokenList.pop()
            classString = classString.strip()

            package = ".".join(tokenList)
#.........这里部分代码省略.........
开发者ID:lsst-dm,项目名称:legacy-pex_harness,代码行数:103,代码来源:Pipeline.py


注:本文中的lsst.pex.logging.Log.getThreshold方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。