Debbugs::Log(3pm) | User Contributed Perl Documentation | Debbugs::Log(3pm) |
Debbugs::Log - an interface to debbugs .log files
The Debbugs::Log module provides a convenient way for scripts to read and write the .log files used by debbugs to store the complete textual records of all bug transactions.
Debbugs::Log does not decode utf8 into perl's internal encoding or encode into utf8 from perl's internal encoding. For html records and all recips, this should probably be done. For other records, this should not be needed.
.log files consist of a sequence of records, of one of the following four types. ^A, ^B, etc. represent those control characters.
^G [mail] ^C
"[mail]" must start with /^Received: \(at \S+\) by \S+;/, and is copied to the output.
^A [mail] ^C
"[mail]" must contain /^X-Debian-Bugs(-\w+)?: This is an autoforward from \S+/. The first line matching that is removed; all lines in the message body that begin with 'X' will be copied to the output, minus the 'X'.
Nothing in debbugs actually generates this record type any more, but it may still be in old .logs at some sites.
^B [recip]^D[recip]^D[...] OR -t ^E [mail] ^C
Each [recip] is output after "Message sent"; "-t" represents the same sendmail option, indicating that the recipients are taken from the headers of the message itself.
^F [html] ^C
[html] is copied unescaped to the output. The record immediately following this one is considered "boring" and only shown in certain output modes.
(This is a design flaw in the log format, since it makes it difficult to change the HTML presentation later, or to present the data in an entirely different format.)
No other types of records are permitted, and the file must end with a ^C line.
Each record is a hash. The "type" field is "incoming-recv", "autocheck", "recips", or "html" as above; "text" contains text from "[mail]" or "[html]" as above; "recips" is a reference to an array of recipients (strings), or undef for "-t".
my $log = Debbugs::Log->new($logfh); my $log = Debbugs::Log->new(bug_num => $nnn); my $log = Debbugs::Log->new(logfh => $logfh);
Parameters
One of the above options must be passed.
Uses exactly the same options as Debbugs::Log::new
print {$log} escape_log(@log)
Applies the log escape regex to the passed logfile.
This module does none of the formatting that bugreport.cgi et al do. It's simply a means for extracting and rewriting raw records.
2020-04-07 | perl v5.30.0 |