本文整理汇总了Python中waflib.Logs.formatter方法的典型用法代码示例。如果您正苦于以下问题:Python Logs.formatter方法的具体用法?Python Logs.formatter怎么用?Python Logs.formatter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类waflib.Logs
的用法示例。
在下文中一共展示了Logs.formatter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: attach
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import formatter [as 别名]
def attach(self):
return
# Attach handlers
if not self.sys_log_handler:
self.sys_log_handler = self.SysLogHandler(self.parent)
waf_logs.set_external_log_handler("options_log", self.sys_log_handler)
if not self.waf_log_handler:
self.waf_log_handler = self.WafLogHandler(self.parent)
self.waf_log_handler.setFormatter(waf_logs.formatter())
log = logging.getLogger('waflib')
log.addHandler(self.waf_log_handler)
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:14,代码来源:gui_tasks.py
示例2: _init_log_no_output
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import formatter [as 别名]
def _init_log_no_output():
# XXX: all this heavily plays with waf internals - only use for unit
# testing bento where waf output screws up nose own output/logging magic
from six.moves import cStringIO
Logs.got_tty = False
Logs.get_term_cols = lambda: 80
Logs.get_color = lambda cl: ''
Logs.colors = Logs.color_dict()
fake_output = cStringIO()
def fake_pprint(col, str, label='', sep='\n'):
fake_output.write("%s%s%s %s%s" % (Logs.colors(col), str, Logs.colors.NORMAL, label, sep))
Logs.pprint = fake_pprint
log = logging.getLogger('waflib')
log.handlers = []
log.filters = []
hdlr = logging.StreamHandler(cStringIO())
hdlr.setFormatter(Logs.formatter())
log.addHandler(hdlr)
log.addFilter(Logs.log_filter())
log.setLevel(logging.DEBUG)
Logs.log = log