summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2006-02-21 22:52:51 +0000
committerNarayan Desai <desai@mcs.anl.gov>2006-02-21 22:52:51 +0000
commit056a24205300a8d7c410b7537c6c31bbf979d8d1 (patch)
tree631a2e2a845206eb63f09d5606ec0ed0a6cffefb /src/lib
parented7df56e513ad4b3173de0ead803a4654510aff9 (diff)
downloadbcfg2-056a24205300a8d7c410b7537c6c31bbf979d8d1.tar.gz
bcfg2-056a24205300a8d7c410b7537c6c31bbf979d8d1.tar.bz2
bcfg2-056a24205300a8d7c410b7537c6c31bbf979d8d1.zip
Fix output logging
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1761 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Client/Toolset.py2
-rw-r--r--src/lib/Logging.py9
2 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/Client/Toolset.py b/src/lib/Client/Toolset.py
index dad808981..aedccce35 100644
--- a/src/lib/Client/Toolset.py
+++ b/src/lib/Client/Toolset.py
@@ -65,7 +65,7 @@ class Toolset(object):
def CondDisplayState(self, phase):
'''Conditionally print tracing information'''
- self.logger.info('Phase: %s' % phase)
+ self.logger.info('\nPhase: %s' % phase)
self.logger.info('Correct entries:\t%d' % self.states.values().count(True))
self.logger.info('Incorrect entries:\t%d' % self.states.values().count(False))
self.logger.info('Total managed entries:\t%d' % len(self.states.values()))
diff --git a/src/lib/Logging.py b/src/lib/Logging.py
index 70270ff23..afaed1c96 100644
--- a/src/lib/Logging.py
+++ b/src/lib/Logging.py
@@ -46,7 +46,7 @@ class TermiosFormatter(logging.Formatter):
self.width = 80
else:
# output to a pipe
- self.width = sys.maxint
+ self.width = 32768
def format(self, record):
'''format a record for display'''
@@ -59,22 +59,21 @@ class TermiosFormatter(logging.Formatter):
else:
inner_lines = int(math.floor(float(len(line)) / line_len))+1
for i in xrange(inner_lines):
- returns.append("%s: %s" % (record.name, line[i*line_len:(i+1)*line_len]))
+ returns.append("%s" % (line[i*line_len:(i+1)*line_len]))
elif type(record.msg) == types.ListType:
record.msg.sort()
- msgwidth = self.width - len(record.name) - 2
+ msgwidth = self.width
columnWidth = max([len(item) for item in record.msg])
columns = int(math.floor(float(msgwidth) / (columnWidth+2)))
lines = int(math.ceil(float(len(record.msg)) / columns))
for lineNumber in xrange(lines):
indices = [idx for idx in [(colNum * lines) + lineNumber
for colNum in range(columns)] if idx < len(record.msg)]
- format = record.name + ':' + (len(indices) * (" %%-%ds " % columnWidth))
+ format = (len(indices) * (" %%-%ds " % columnWidth))
returns.append(format % tuple([record.msg[idx] for idx in indices]))
elif type(record.msg) == lxml.etree._Element:
returns.append(str(xml_print(record.msg)))
else:
- returns.append("Got unsupported type %s" % (str(type(record.msg))))
returns.append(record.name + ':' + str(record.msg))
if record.exc_info:
returns.append(self.formatException(record.exc_info))