utr: filter some new steps

Some recipe updates has led to a bunch of new steps that, by default,
appear in the cli output. Filter some of these.

Additionally, whatever function was used to parse the last step would
be used to parse the rdb wrap so a default needs to be set whenever
a step has completed

See https://paste.googleplex.com/6309784703205376 for an example

Bug: 41492688
Change-Id: If1f23fd852619f50fadf1e7d8fe3d5354b9e4dab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5405707
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Commit-Queue: Struan Shrimpton <sshrimp@google.com>
Cr-Commit-Position: refs/heads/main@{#1279945}
diff --git a/tools/utr/output_adapter.py b/tools/utr/output_adapter.py
index df6da25e..e81ae1d 100644
--- a/tools/utr/output_adapter.py
+++ b/tools/utr/output_adapter.py
@@ -66,17 +66,29 @@
         r'@@@STEP_LINK@shard (#\d+) test results@(https://[^@]+)@@@')
 
     self._current_proccess_fn = self._StepNameProcessLine
-    # The first match is used. By default _StepNameProcessLine will be used
-    # which prints the step name and it's stdout
+    # The first match is used. This allows us to filter parent steps while still
+    # printing child steps by adding the child step name first. By default
+    # _StepNameProcessLine will be used which prints the step name and it's
+    # stdout
     self._step_to_processors = {
         'compile': self._ProcessCompileLine,
         'reclient compile': self._ProcessCompileLine,
         'test_pre_run.[trigger] ': self._ProcessTriggerLine,
         'collect tasks.wait for tasks': self._ProcessCollectLine,
     }
-    # The first match is used. By default INFO will be used which prints in
-    # non-verbose mode (i.e. no -v flag)
+    # The first match is used. This allows us to filter parent steps while still
+    # printing child steps by adding the child step name first. By default INFO
+    # will be used which prints in non-verbose mode (i.e. no -v flag)
     self._step_to_log_level = {
+        'lookup_builder_gn_args': logging.DEBUG,
+        'git rev-parse': logging.DEBUG,
+        'git diff to instrument': logging.DEBUG,
+        'save paths of affected files': logging.DEBUG,
+        'preprocess for reclient.start reproxy via bootstrap': logging.INFO,
+        'preprocess for reclient': logging.DEBUG,
+        'process clang crashes': logging.DEBUG,
+        'compile confirm no-op': logging.DEBUG,
+        'postprocess for reclient': logging.DEBUG,
         'setup_build': logging.DEBUG,
         'get compile targets for scripts': logging.DEBUG,
         'lookup GN args': logging.DEBUG,
@@ -195,6 +207,10 @@
       self._test_results_link = link
     self._current_proccess_fn(line)
     self._last_line = line
+    if line.startswith(self.STEP_CLOSED_TEXT):
+      # Text outside of steps will use the last processor otherwise
+      self._current_log_level = logging.DEBUG
+      _current_proccess_fn = self._StepNameProcessLine
 
   def _get_processor(self, step_name):
     if step_name in self._step_to_processors: