logging, colors, terminal width and pretty-print
Get the console width in characters.
Returns: | the number of characters per line |
---|---|
Return type: | int |
Get the console width in characters.
Returns: | the number of characters per line |
---|---|
Return type: | int |
Bases: logging.Filter
The waf logs are of the form ‘name: message’, and can be filtered by ‘waf –zones=name’. For example, the following:
from waflib import Logs
Logs.debug('test: here is a message')
Will be displayed only when executing:
$ waf --zones=test
Bases: logging.Formatter
Simple log formatter which handles colors
global logger for Logs.debug, Logs.error, etc
Wrap logging.debug, the output is filtered for performance reasons
Wrap logging.errors, display the origin of the message when ‘-vv’ is set
Create a simple logger, which is often used to redirect the context command output:
from waflib import Logs
bld.logger = Logs.make_logger('test.log', 'build')
bld.check(header_name='sadlib.h', features='cxx cprogram', mandatory=False)
bld.logger = None
Parameters: |
|
---|
Create a memory logger to avoid writing concurrently to the main logger
Print messages in color immediately on stderr:
from waflib import Logs
Logs.pprint('RED', 'Something bad just happened')
Parameters: |
|
---|