When extracting log lines associated with a certain session (var names), the negatives could be overwritten to form the new filtered, cmds.log. However, this destroys the logging handle set up in python.
Find a way to edit cmds.log without destroying the handle, or similar solution that prevents the cmds.log to grow indefinitely.