本文整理汇总了Python中waflib.Logs.log_filter方法的典型用法代码示例。如果您正苦于以下问题:Python Logs.log_filter方法的具体用法?Python Logs.log_filter怎么用?Python Logs.log_filter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类waflib.Logs
的用法示例。
在下文中一共展示了Logs.log_filter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _init_log_no_output
# 需要导入模块: from waflib import Logs [as 别名]
# 或者: from waflib.Logs import log_filter [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