本文整理汇总了Python中toolset.utils.output_helper.log函数的典型用法代码示例。如果您正苦于以下问题:Python log函数的具体用法?Python log怎么用?Python log使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了log函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: watch_container
def watch_container(docker_container, docker_file):
with open(
os.path.join(
run_log_dir, "%s.log" % docker_file.replace(
".dockerfile", "").lower()), 'w') as run_log:
for line in docker_container.logs(stream=True):
log(line, prefix=log_prefix, file=run_log)
示例2: log_build_flush
def log_build_flush(self, file):
for b_log in self.build_logs:
log(b_log['str'],
prefix=b_log['log_prefix'],
file=file,
color=Fore.YELLOW)
self.build_logs = []
示例3: log_verify_end
def log_verify_end(self, log_prefix, file):
total = int(time.time() - self.verify_start)
self.verify_total = self.verify_total + total
log("Verify time: %s" % TimeLogger.output(total),
prefix=log_prefix,
file=file,
color=Fore.YELLOW)
示例4: log_benchmarking_end
def log_benchmarking_end(self, log_prefix, file):
total = int(time.time() - self.benchmarking_start)
self.benchmarking_total = self.benchmarking_total + total
log("Benchmarking time: %s" % TimeLogger.output(total),
prefix=log_prefix,
file=file,
color=Fore.YELLOW)
示例5: log_test_end
def log_test_end(self, log_prefix, file):
total = int(time.time() - self.test_start)
log("Total test time: %s" % TimeLogger.output(total),
prefix=log_prefix,
file=file,
color=Fore.YELLOW)
log("Total time building so far: %s" % TimeLogger.output(
self.build_total),
prefix="tfb: ",
file=file,
color=Fore.YELLOW)
log("Total time verifying so far: %s" % TimeLogger.output(
self.verify_total),
prefix="tfb: ",
file=file,
color=Fore.YELLOW)
if self.benchmarking_total > 0:
log("Total time benchmarking so far: %s" % TimeLogger.output(
self.benchmarking_total),
prefix="tfb: ",
file=file,
color=Fore.YELLOW)
running_time = int(time.time() - self.start)
log("Total execution time so far: %s" %
TimeLogger.output(running_time),
prefix="tfb: ",
file=file,
color=Fore.YELLOW)