From 575a269c1e972aa88cb65d889e690b201429895d Mon Sep 17 00:00:00 2001 From: shnavid Date: Tue, 7 Aug 2007 15:31:40 +0000 Subject: nicer html output git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@341 ef72aa8b-4018-0410-8976-d6e080ef94d8 --- src/extras/htmlog | 164 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 117 insertions(+), 47 deletions(-) (limited to 'src/extras/htmlog') diff --git a/src/extras/htmlog b/src/extras/htmlog index 7765d09f..d8148315 100755 --- a/src/extras/htmlog +++ b/src/extras/htmlog @@ -77,7 +77,7 @@ class logfile_class: self.curline.split()[3] # system is booting - if self.curmessage().startswith("Linux version"): + if self.curmessage().startswith("kernel: Linux version"): self.add_event("system boot") # hostname has changed @@ -87,7 +87,7 @@ class logfile_class: # the clock is wrong wrong if self.prevline and time.strptime(self.prevline[0:15], "%b %d %H:%M:%S") > self.time_current(): - self.add_event("clock is fucked up") + self.add_event("clock is messed up") def add_event(self, message): self.events.append( (self.curline_pos,len(self.curline),message) ) @@ -107,62 +107,109 @@ for logname in __cmdLineOpts__.logfiles: log.parse() logs.append(log) -print """ - - -HTMLogs output +print """ + + + + - - + + + """ print '' -print "" +print """ +
+ +""" + +previous_date = None +inc = 0 + while True: # who is next ? lowest_date = None @@ -190,9 +244,21 @@ while True: # all logs are EOF break - print " " + if inc == 0 or inc % 200 == 0: + print """""" + + if not previous_date or time.strftime("%b %d", previous_date) != time.strftime("%b %d", lowest_date): + print """""" % time.strftime("%A, %B %d", lowest_date) + + if inc % 2 == 0: row_class = "spec" + else: row_class = "altspec" + # FIXME: if this tick has an event, add - print ' " + if not previous_date or previous_date != lowest_date: + print """""" + else: + print """""" + for log in logs: if log.time_current() == lowest_date: print " " @@ -201,7 +267,11 @@ while True: print " " # print log.curline_pos, time.strftime("%b %d %H:%M:%S", log.time_current()), log.curmessage() print " " -print "
Generated by SOS htmlogger 1.0 on March 16th 2008
Time of Eventnode-1node-2node-3
%s
' + time.strftime("%b %d %H:%M:%S", lowest_date) + "
""" + time.strftime("%H:%M:%S", lowest_date) + """
""" + time.strftime("%H:%M:%S", lowest_date) + """" + log.curmessage() + "
" + + previous_date = lowest_date + inc += 1 + +print "
" -- cgit