Opened 14 years ago

Last modified 8 years ago

#66 assigned enhancement

Log handling

Reported by: Joachim Langenbach Owned by: Bruno Cornec
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 Langenbach 14 years ago.
A Perl class to handle the log analyze, output and mailing
Item.pm (3.9 KB ) - added by Joachim Langenbach 14 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 Langenbach 14 years ago.
An example perl script to demonstrate the usage and features
combined.log (157.6 KB ) - added by Joachim Langenbach 14 years ago.
a sample logfile which is analyzed by logtest.pl

Download all attachments as: .zip

Change History (11)

by Joachim Langenbach, 14 years ago

Attachment: Log.pm added

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

by Joachim Langenbach, 14 years ago

Attachment: Item.pm added

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

by Joachim Langenbach, 14 years ago

Attachment: logtest.pl added

An example perl script to demonstrate the usage and features

by Joachim Langenbach, 14 years ago

Attachment: combined.log added

a sample logfile which is analyzed by logtest.pl

comment:1 by Joachim Langenbach, 14 years ago

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 by Bruno Cornec, 14 years ago

Milestone: 0.9.110.9.12
Status: newassigned
Type: taskenhancement

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 by Bruno Cornec, 14 years ago

Milestone: 0.9.120.9.11
Version: 0.9.110.9.10

comment:4 by Bruno Cornec, 13 years ago

Milestone: 0.10.10.10.2

comment:5 by Bruno Cornec, 13 years ago

Milestone: 0.11.30.11.4

comment:6 by Bruno Cornec, 12 years ago

Milestone: 0.12.10.12.2

comment:7 by Bruno Cornec, 8 years ago

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