[rtems-tools commit] rtemstoolkit/log: Add info().

Chris Johns chrisj at rtems.org
Tue Jun 11 23:52:08 UTC 2019


Module:    rtems-tools
Branch:    master
Commit:    5dd75b028aeb8dd80efdb5357fd4e2b4487a1622
Changeset: http://git.rtems.org/rtems-tools/commit/?id=5dd75b028aeb8dd80efdb5357fd4e2b4487a1622

Author:    Chris Johns <chrisj at rtems.org>
Date:      Thu May 30 20:25:36 2019 +1000

rtemstoolkit/log: Add info().

---

 rtemstoolkit/log.py     | 14 ++++++++++++++
 rtemstoolkit/options.py |  3 +--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/rtemstoolkit/log.py b/rtemstoolkit/log.py
index a06c8c1..00fdb05 100755
--- a/rtemstoolkit/log.py
+++ b/rtemstoolkit/log.py
@@ -61,6 +61,20 @@ quiet = False
 #
 lock = threading.Lock()
 
+def info(args):
+    s = [' Command Line: %s' % (' '.join(args))]
+    if hasattr(os, 'uname'):
+        s += [' Host: %s' % (' '.join(os.uname()))]
+    else:
+        h = ' Host: win32-mingw'
+        if 'HOSTTYPE' in os.environ:
+            h += ' ' + os.environ['HOSTTYPE']
+        else:
+            h += ' i686'
+        s += [h]
+    s += [' Python: %s' % (sys.version.replace('\n', ''))]
+    return s
+
 def set_default_once(log):
     if default is None:
         default = log
diff --git a/rtemstoolkit/options.py b/rtemstoolkit/options.py
index dcb8980..32a7016 100644
--- a/rtemstoolkit/options.py
+++ b/rtemstoolkit/options.py
@@ -508,8 +508,7 @@ class command_line(object):
         return None
 
     def log_info(self):
-        log.output(' Command Line: %s' % (' '.join(self.argv)))
-        log.output(' Python: %s' % (sys.version.replace('\n', '')))
+        log.output(log.info(self.argv))
 
 def load(opts):
     """



More information about the vc mailing list