當前位置: 首頁>>代碼示例>>Python>>正文


Python Logger.debug方法代碼示例

本文整理匯總了Python中mantid.kernel.Logger.debug方法的典型用法代碼示例。如果您正苦於以下問題:Python Logger.debug方法的具體用法?Python Logger.debug怎麽用?Python Logger.debug使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在mantid.kernel.Logger的用法示例。


在下文中一共展示了Logger.debug方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: PluginLoader

# 需要導入模塊: from mantid.kernel import Logger [as 別名]
# 或者: from mantid.kernel.Logger import debug [as 別名]
class PluginLoader(object):

    extension = ".py"

    def __init__(self, filepath):
        if not _os.path.isfile(filepath):
            raise ValueError("PluginLoader expects a single filename. '%s' does not point to an existing file" % filepath)
        if not filepath.endswith(self.extension):
            raise ValueError("PluginLoader expects a filename ending with .py. '%s' does not have a .py extension" % filepath)
        self._filepath = filepath
        self._logger = Logger("PluginLoader")

    def run(self):
        """
            Try and load the module we are pointing at and return
            the module object.

            Any ImportErrors raised are not caught and are passed
            on to the caller
        """
        pathname = self._filepath
        name = _os.path.basename(pathname) # Including extension
        name = _os.path.splitext(name)[0]
        self._logger.debug("Loading python plugin %s" % pathname)
        return _imp.load_source(name, pathname)
開發者ID:liyulun,項目名稱:mantid,代碼行數:27,代碼來源:plugins.py

示例2: test_unicode_logger

# 需要導入模塊: from mantid.kernel import Logger [as 別名]
# 或者: from mantid.kernel.Logger import debug [as 別名]
    def test_unicode_logger(self):
        logger = Logger("LoggerTest")
        self.assertTrue(isinstance(logger, Logger))
        for att in ['fatal', 'error', 'warning', 'notice', 'information', 'debug']:
            if not hasattr(logger, att):
                self.fail("Logger object does not have the required attribute '%s'" % att)

        logger.fatal('This is a test')
        logger.error('This is a test')
        logger.warning('This is a test')
        logger.notice('This is a test')
        logger.information('This is a test')
        logger.debug('This is a test')
開發者ID:mantidproject,項目名稱:mantid,代碼行數:15,代碼來源:LoggerTest.py


注:本文中的mantid.kernel.Logger.debug方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。