本文整理汇总了Python中nta.utils.logging_support_raw.LoggingSupport.getLoggingRootDir方法的典型用法代码示例。如果您正苦于以下问题:Python LoggingSupport.getLoggingRootDir方法的具体用法?Python LoggingSupport.getLoggingRootDir怎么用?Python LoggingSupport.getLoggingRootDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nta.utils.logging_support_raw.LoggingSupport
的用法示例。
在下文中一共展示了LoggingSupport.getLoggingRootDir方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testLoggingAppPath
# 需要导入模块: from nta.utils.logging_support_raw import LoggingSupport [as 别名]
# 或者: from nta.utils.logging_support_raw.LoggingSupport import getLoggingRootDir [as 别名]
def testLoggingAppPath(self):
# getApplicationLogFilePath() should return path to ../app_name.log
app_name = "py" # Because called with py.test
with self._redirectLogBase(app_name, _SAMPLE_CONNECTION_CONTENTS):
temp_ls = LS()
temp_ls.initLogging("DEBUG", "stderr", True)
self.assertEqual(os.path.abspath(os.path.join(temp_ls.getLoggingRootDir(), "processes", app_name + ".log")), temp_ls.getApplicationLogFilePath())
示例2: testLoggingRootPath
# 需要导入模块: from nta.utils.logging_support_raw import LoggingSupport [as 别名]
# 或者: from nta.utils.logging_support_raw.LoggingSupport import getLoggingRootDir [as 别名]
def testLoggingRootPath(self):
# getLoggingRootDir() should return the temp path
with self._redirectLogBase("logging_example", _SAMPLE_CONNECTION_CONTENTS):
tempLS = LS()
tempLS.initLogging("DEBUG", "stderr", True)
self.assertEqual(tempLS.getLoggingRootDir(),
os.path.join(self._tempDir, "log"))
示例3: testLoggingAppPath
# 需要导入模块: from nta.utils.logging_support_raw import LoggingSupport [as 别名]
# 或者: from nta.utils.logging_support_raw.LoggingSupport import getLoggingRootDir [as 别名]
def testLoggingAppPath(self):
# getApplicationLogFilePath() should return path to ../appName.log
appName = os.path.splitext(os.path.basename(sys.argv[0]))[0]
with self._redirectLogBase(appName, _SAMPLE_CONNECTION_CONTENTS):
tempLS = LS()
tempLS.initLogging("DEBUG", "stderr", True)
self.assertEqual(os.path.abspath(os.path.join(tempLS.getLoggingRootDir(),
"processes",
appName + ".log")),
tempLS.getApplicationLogFilePath())
self.assertIn(appName, ["py", "run_tests"])