本文整理汇总了Python中waflib.Logs.free_logger方法的典型用法代码示例。如果您正苦于以下问题:Python Logs.free_logger方法的具体用法?Python Logs.free_logger怎么用?Python Logs.free_logger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类waflib.Logs
的用法示例。
在下文中一共展示了Logs.free_logger方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: finalize
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import free_logger [as 别名]
def finalize(self):
try:
logger = self.logger
except AttributeError:
pass
else:
Logs.free_logger(logger)
delattr(self, "logger")
示例2: finalize
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import free_logger [as 别名]
def finalize(self):
"""
Use to free resources such as open files potentially held by the logger
"""
try:
logger = self.logger
except AttributeError:
pass
else:
Logs.free_logger(logger)
delattr(self, 'logger')
示例3: finalize
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import free_logger [as 别名]
def finalize(self):
"""
Called to free resources such as logger files
"""
try:
logger = self.logger
except AttributeError:
pass
else:
Logs.free_logger(logger)
delattr(self, 'logger')
示例4: benchmarks_format_output
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import free_logger [as 别名]
def benchmarks_format_output (bch):
# The logger is freed at the end of the benchmarks function but the tasks are
# performed afterwards, so we recreate the logger.
logfile = os.path.join (bch.bldnode.abspath(), "benchmarks_run.log")
bch.logger = Logs.make_logger (logfile, "benchmarks_run")
lst = sorted (getattr (bch, 'bench_results', []), key = lambda x:x[0])
for (f, ret, log) in lst:
bch.start_msg (f.relpath ())
if ret == 0:
bch.end_msg (log.relpath())
else:
bch.end_msg ("Error", color = "RED")
Logs.free_logger (bch.logger)
bch.logger = None