[PATCH 3/7] rtemstoolkit/log: Add info().
chrisj at rtems.org
chrisj at rtems.org
Sun Jun 9 00:24:58 UTC 2019
From: Chris Johns <chrisj at rtems.org>
---
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):
"""
--
2.20.1 (Apple Git-117)
More information about the devel
mailing list