Opened 9 years ago

Last modified 3 years ago

#66 assigned enhancement

Log handling

Reported by: joachim Owned by: bruno
Priority: major Milestone:
Component: pb Version: 0.9.10
Keywords: Cc:

Description

To handle the output of pb a bit better than now, the output should be analyzed for warnings and errors (divided between build process and packaging issues, or may be more). It should be possible to mail the output afterwards to defined adresses.

Attachments (4)

Log.pm (5.5 KB) - added by joachim 9 years ago.
A Perl class to handle the log analyze, output and mailing
Item.pm (3.9 KB) - added by joachim 9 years ago.
The class is used by PB::Log (Log.pm) to store the log's per machine
logtest.pl (277 bytes) - added by joachim 9 years ago.
An example perl script to demonstrate the usage and features
combined.log (157.6 KB) - added by joachim 9 years ago.
a sample logfile which is analyzed by logtest.pl

Download all attachments as: .zip

Change History (11)

Changed 9 years ago by joachim

A Perl class to handle the log analyze, output and mailing

Changed 9 years ago by joachim

The class is used by PB::Log (Log.pm) to store the log's per machine

Changed 9 years ago by joachim

An example perl script to demonstrate the usage and features

Changed 9 years ago by joachim

a sample logfile which is analyzed by logtest.pl

comment:1 Changed 9 years ago by joachim

I've created an object based Loganalyzer as a starting point. Right now it can separate a combined logfile (whole pb run) into each machine parts. It can also handle directly the log foreach machine.

Per machine it analyzes the qa (from lintian and rpmlint) errors and warnings and separetly all other errors and warnings. It decides an a array of strings, which string must be into a line, to be an error, a warning or nothing. also excludes can be defined.

It can generate a summary over all machines. This summary can be printed to the shell or send via mail.

The mail function is only really basic implementation, which must be improved a bit.

I didn't figure out, where the output can be fetched and redirected (or a copy) to the log object during pb run.

Concerning style, I've tried to use not camelcase variable names, because I think, that you preferre such style. Is that also true for function and object names? The documentation is also quiet short and not in perl doc format.

It can be tested with logtest.pl in such structure:

  • logtest.pl
  • combined.log
  • PB
    • Log.pm
    • Log
    • Item.pm

So I hope, this will be welcome as a start base!

comment:2 Changed 9 years ago by bruno

  • Milestone changed from 0.9.11 to 0.9.12
  • Status changed from new to assigned
  • Type changed from task to enhancement

Indeed very welcome ! Thanks for that.

The style was nearly good. I just added some spaces around if usages (if(test){ => if (test) {). Same for foreach.

I also think that there is duplicated code in the analysis, that could be factorized later on. I did a basic introduction of the code, in order to allow you to use it. Now we need to improve the pod doc, the Log.t test file and see how to use this code in pb itself.

comment:3 Changed 9 years ago by bruno

  • Milestone changed from 0.9.12 to 0.9.11
  • Version changed from 0.9.11 to 0.9.10

comment:4 Changed 8 years ago by bruno

  • Milestone changed from 0.10.1 to 0.10.2

comment:5 Changed 8 years ago by bruno

  • Milestone changed from 0.11.3 to 0.11.4

comment:6 Changed 7 years ago by bruno

  • Milestone changed from 0.12.1 to 0.12.2

comment:7 Changed 3 years ago by bruno

  • Milestone 0.13.2 deleted
Note: See TracTickets for help on using tickets.