本文整理汇总了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)
示例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')