Debbugs::Log(3pm)
π NAME π
Debbugs::Log β bestie, it's an interface to debbugs .log files π
πΈ DESCRIPTION πΈ
Okay so listen β the Debbugs::Log module is literally the convenient lil way for your scripts to read and write the .log files that debbugs uses to store the complete textual records of all bug transactions. Iconic archival behavior, no cap. β¨
But here's the tea, and it's important: Debbugs::Log does not decode utf8 into perl's internal encoding, and it does not 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. So likeβ¦ know that about her π«Ά
πΌ The .log File Format πΌ
So .log files are just a sequence of records, and each record is one of the following four types. And when we say ^A, ^B, etc.? Those represent the actual control characters, bestie. Fr fr.
incoming-recv
^G
[mail]
^C
So [mail] must start with /^Received: \(at \S+\) by \S+;/, and then it gets copied to the output. Simple as that π
autocheck
Auto-forwarded messages are recorded like this:
^A
[mail]
^C
And [mail] must contain /^X-Debian-Bugs(-\w+)?: This is an autoforward from \S+/. The first line matching that gets removed, and then every line in the message body that begins with 'X' gets copied to the output β minus the 'X' itself. Sneaky lil transformation, iykyk π
β οΈ Real talk: nothing in debbugs actually generates this record type any more, but it may still be hanging around in old .logs at some sites. Vintage queen behavior.
recips
^B
[recip]^D[recip]^D[...] OR -t
^E
[mail]
^C
Each [recip] is output after "Message sent". And "-t" represents the same sendmail option, indicating that the recipients are taken from the headers of the message itself π
html
^F
[html]
^C
[html] is copied unescaped to the output. And 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.)
And that's the whole menu β no other types of records are permitted, and the file must end with a ^C line. Periodt. π
π§ Perl Record Representation π§
Each record is a hash, bestie. The "type" field is "incoming-recv", "autocheck", "recips", or "html" as above; "text" contains text from "[mail]" or "[html]" as above; and "recips" is a reference to an array of recipients (strings), or undef for "-t". Slay β¨
β¨ FUNCTIONS β¨
newβ Creates a new log reader based on a.logfilehandle. Look at her go:
my $log = Debbugs::Log->new($logfh);
my $log = Debbugs::Log->new(bug_num => $nnn);
my $log = Debbugs::Log->new(logfh => $logfh);
Parameters
bug_numβ bug numberlogfhβ log filehandlelog_nameβ name of log
π One of the above options must be passed. That's the vibe check.
read_recordβ Reads and returns a single record from a log reader object. At end of file, returnsundef. Throws exceptions usingdie(), so you may want to wrap this in aneval()π (yes theevalis load-bearing, bestie)read_log_recordsβ Takes a.logfilehandle as input, and returns an array of all records in that file. Throws exceptions usingdie(), so you may want to wrap this in aneval()too π«Ά
Uses exactly the same options as Debbugs::Log::new
write_log_recordsβ Takes a filehandle and a list of records as input, and prints the.logformat representation of those records to that filehandle. Go off, writer girl π
π₯ escape_log π₯
print {$log} escape_log(@log)
Applies the log escape regex to the passed logfile. That's it, that's the function πΈ
π«Ά CAVEATS π«Ά
So this module does none of the formatting that bugreport.cgi et al do. Ngl, it's simply a means for extracting and rewriting raw records. Raw data only, no glow-up included π
And that's the whole page, bestie! π This lil manual came to you from perl v5.40.1, dated 2026-04-27, and it's part of the User Contributed Perl Documentation collection. Go read some .log files, you main character π
π
π¦ where this page comes from
- ubuntu stonking: libdebbugs-perl 2.6.5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms