Patchwork [bitbake-devel,7/8] knotty.py: Add ability to dynamically toggle log location

login
register
mail settings
Submitter Jason Wessel
Date Sept. 17, 2012, 10:43 p.m.
Message ID <1347921818-60562-8-git-send-email-jason.wessel@windriver.com>
Download mbox | patch
Permalink /patch/36677/
State New
Headers show

Comments

Jason Wessel - Sept. 17, 2012, 10:43 p.m.
Add the ability to see where all the per task logs
were written to disk.

The resulting output looks like where [...] is the full path:

NOTE: LOG: [...]/python-2.7.2-r2.20/temp/log.do_package_setscene.8719
NOTE: LOG: [...]/perl-5.14.2-r7/temp/log.do_package_setscene.8760

(LOCAL REV: NOT UPSTREAM)

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
 lib/bb/ui/knotty.py |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

Patch

diff --git a/lib/bb/ui/knotty.py b/lib/bb/ui/knotty.py
index df8de0f..2d58ebe 100644
--- a/lib/bb/ui/knotty.py
+++ b/lib/bb/ui/knotty.py
@@ -273,6 +273,7 @@  class StdinMgr:
 class RtLogLevel:
     def __init__(self, handler, logfilter, mlt, tf):
         self.displaytail = False
+        self.displayLogLocations = False
         self.handler = handler
         self.logfilter = logfilter
         self.defaultLevel = logfilter.getFiltLevel()
@@ -319,6 +320,14 @@  class RtLogLevel:
                 print "NOTE: Turning on task notes"
             if isinstance(self.tf, TerminalFilter):
                 self.tf.setFilterOff()
+        elif input == "l":
+            if verbose:
+                print "NOTE: Activating log locations display"
+            self.displayLogLocations = True
+        elif input == "L":
+            if verbose:
+                print "NOTE: Disable log locations display"
+            self.displayLogLocations = False
         elif input == "h" or input == "?":
             print "============================================="
             print "Interaction help commands:"
@@ -327,6 +336,7 @@  class RtLogLevel:
             print " 2 - turn on real time log tail"
             print " 3 - turn on debug logging"
             print " 4 - turn on debug logging and real time log tail"
+            print " l - emit log locations (L to turn off)"
             print " t - Display tasks in \"top\" mode"
             print " N - Display all runtime NOTE's that are normally filtered (0 or 1 toggles off)"
             print " h - display commands"
@@ -416,6 +426,9 @@  def main(server, eventHandler, tf = TerminalFilter):
                 continue
             helper.eventHandler(event)
             if isinstance(event, bb.build.TaskStarted):
+                if (rtloglevel.displayLogLocations):
+                    termfilter.clearFooter()
+                    print "NOTE: LOG: %s" % event.logfile
                 mlt.openLog(event.logfile, event.pid)
                 rtloglevel.displayLogs()