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


Python Logger.createErrorMessage方法代码示例

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


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

示例1: _getDetailedError

# 需要导入模块: from pyaid.debug.Logger import Logger [as 别名]
# 或者: from pyaid.debug.Logger.Logger import createErrorMessage [as 别名]
 def _getDetailedError(cls, message, error):
     return '\n'.join([
         Logger.logMessageToString(Logger.createLogMessage(
             logValue=Logger.createErrorMessage(message, error),
             traceStack=True,
             shaveStackTrace=0,
             htmlEscape=False)),
         'VERSION: {}'.format(sys.version) ])
开发者ID:sernst,项目名称:Nimble,代码行数:10,代码来源:MayaRouter.py

示例2: run

# 需要导入模块: from pyaid.debug.Logger import Logger [as 别名]
# 或者: from pyaid.debug.Logger.Logger import createErrorMessage [as 别名]
    def run(self):
        """ Executes the analysis process, iterating through each of the analysis stages before
            cleaning up and exiting. """

        print('[OUTPUT PATH]: %s' % self.analysisRootPath)
        print(analysisStamp)
        print(tracksStamp)

        self._startTime = TimeUtils.getNowDatetime()

        myRootPath = self.getPath(isDir=True)
        if os.path.exists(myRootPath):
            FileUtils.emptyFolder(myRootPath)
        if not os.path.exists(myRootPath):
            os.makedirs(myRootPath)

        tempPath = self.tempPath
        if os.path.exists(tempPath):
            SystemUtils.remove(tempPath)
        os.makedirs(tempPath)

        if not self.logger.loggingPath:
            self.logger.loggingPath = myRootPath

        try:
            session = self.getAnalysisSession()
            self._preAnalyze()
            for stage in self._stages:
                self._currentStage = stage
                stage.analyze()
            self._currentStage = None
            self._postAnalyze()

            session.commit()
            session.close()
            self._success = True
        except Exception as err:
            session = self.getAnalysisSession()
            session.close()
            msg = [
                '[ERROR]: Failed to execute analysis',
                'STAGE: %s' % self._currentStage]
            self._errorMessage = Logger.createErrorMessage(msg, err)
            self.logger.writeError(msg, err)

        session = self.getTracksSession()
        session.close()

        self._cleanup()
        SystemUtils.remove(tempPath)

        self.logger.write('\n\n[%s]: %s (%s)' % (
            'SUCCESS' if self._success else 'FAILED',
            self.__class__.__name__,
            TimeUtils.toPrettyElapsedTime(self.elapsedTime)
        ), indent=False)
开发者ID:sernst,项目名称:Cadence,代码行数:58,代码来源:AnalyzerBase.py

示例3: unloadGeneralPlugin

# 需要导入模块: from pyaid.debug.Logger import Logger [as 别名]
# 或者: from pyaid.debug.Logger.Logger import createErrorMessage [as 别名]
def unloadGeneralPlugin(force =False):
    try:
        #from elixir.plugins.general import ElixirGeneralPlugin
        results = cmds.unloadPlugin('ElixirGeneralPlugin', force=force)
        if not results:
            print('ERROR: Failed to unload the Elixir General Plugin')
            return False
        return True
    except Exception as err:
        print(Logger.createErrorMessage('ERROR: Failed to unload the Elixir General Plugin', err))
        return False
开发者ID:sernst,项目名称:Elixir,代码行数:13,代码来源:__init__.py

示例4: __call__

# 需要导入模块: from pyaid.debug.Logger import Logger [as 别名]
# 或者: from pyaid.debug.Logger.Logger import createErrorMessage [as 别名]
    def __call__(self, *args, **kwargs):
        """Doc..."""
        if self.response is None:
            self.response = RemoteScriptResponse()
        if self.kwargs is None:
            self.kwargs = kwargs

        try:
            self.run()
        except Exception as err:
            message = "Nimble remote script run failure"
            NimbleEnvironment.logError(message, err)
            logMessage = Logger.createErrorMessage(message, err)
            self.putErrorResult(Logger.logMessageToString(logMessage=logMessage, includePrefix=False))
        result = self.response.result
        return result if result else dict()
开发者ID:sernst,项目名称:Nimble,代码行数:18,代码来源:NimbleScriptBase.py

示例5: loadGeneralPlugin

# 需要导入模块: from pyaid.debug.Logger import Logger [as 别名]
# 或者: from pyaid.debug.Logger.Logger import createErrorMessage [as 别名]
def loadGeneralPlugin():
    """ Loads the elixir general plugin. Must be called within Maya. """

    try:
        if cmds.pluginInfo('ElixirGeneralPlugin', loaded=True):
            return True
    except Exception:
        pass

    try:
        from elixir.plugins.general import ElixirGeneralPlugin
        cmds.loadPlugin(ElixirGeneralPlugin.__file__)
        return True
    except Exception as err:
        print(Logger.createErrorMessage('ERROR: Failed to load Elixir General Plugin', err))
        return False
开发者ID:sernst,项目名称:Elixir,代码行数:18,代码来源:__init__.py


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