log.add_log_file(path) allows to pass a file path log messages will be written into. Special characters (e.g. console color codes) will be removed from the messages.
<W> jw-client-devops-web.py [ 29] Exiting jw-client-devops-web.py Exception ignored in: <function App.__del__ at 0x7f3ddeb8f560> Traceback (most recent call last): File "/home/jan/local/src/jw.dev/proj/jw-client-devops-web/src/python/jw/devops/client/web/cmds/App.py", line 43, in __del__ File "/home/jan/local/src/jw.dev/proj/jw-python/tools/python/jwutils/log.py", line 167, in slog File "/home/jan/local/src/jw.dev/proj/jw-python/tools/python/jwutils/log.py", line 126, in get_caller_pos AttributeError: 'NoneType' object has no attribute '__name__'
Add functions log.(add|rm)_capture_stream(). The functions are meant to capture everything passed to syslog into the stream objects installed by it. Not sure about future semantics changes: add_capture_stream() takes a currently unused flags argument, and it suppresses everything else logged until the stream is removed again.
If module is present in the log flags string, the module is prepended to each log message. The length of the module prefix can be set via the new set_module_name_length() function.
monkeytype run jw-acc.py --log-level debug db import --format mdb-json-dir dbs
monkeytype list-modules | grep ^jw | while read m; do
monkeytype apply $m
done
Add only_printable keyword argument to slog(). It defaults to False. If it's true, non-printable characters are not logged but replaced with a printable character.
Add a kwargs keyword argument. This should allow a kwargs containing a "caller=" argument to be passed to the function and just do the right thing. Badly tested.
- Add functions: append_to_prefix(), remove_from_prefix() set_filename_length() - Make slog_m() log one list item per line - Add console_color_chars(prio)
o basestring is merged into str o print() needs parentesis o Class inheritance syntax changed o Abstract baseclass (ABCMeta) syntax changed o map.iteritems() is replaced by map.items() o Inconsistent use of tabs and spaces are no longer tolerated