Report(3pm)
π Lire::Report β Interface to a Lire report π
okay so this is Report(3pm) from LogReport's Lire Documentation, and bestie, it's literally the API for the reports that Lire generates. it's giving "main character of the report world" energy. let's get into it π
β¨ NAME β¨
Lire::Report β the interface to a Lire report, periodt. π
πΈ SYNOPSIS πΈ
like, here's the vibe in code form:
use Lire::ReportParser::ReportBuilder;
my $parser = new Lire::ReportParser::ReportBuilder;
my $report = $parser->parse( "report.xml" );
print $report->superservice(), " report\n";
print "Generated on ", scalar( localtime( $report->date() ) ), "\n";
print "Timespan starts on ", scalar( localtime( $report->timespan_start() ) ), "\n";
print "Timespan ends on ", scalar( localtime( $report->timespan_start() ) ), "\n";
foreach my $s ( $report->sections() ) {
print "Section: '", $s->title(), "' has ", scalar $s->subreports(),
" subreports in it\n";
}
(no i will not "fix" that timespan_start() on the ends line β it's in the original, so it stays exactly as-is, copy-paste energy preserved fr fr π)
π¦ DESCRIPTION π¦
this module hands you an API to the report that Lire generates. you can use Lire::ReportParser::ReportBuilder(3pm) to build a Lire::Report object out of an XML file that complies with the Lire Report Markup Language DTD. iconic behavior honestly π
π CONSTRUCTOR π
a Lire::Report object can be built from an XML report file, from the new() method, or from a Lire::ReportConfig object. three ways in, choose your fighter β¨
π new( [ $timespan_period ], [ $timespan_start ], [ $timespan_end ] )
creates a shiny new Lire::Report. the $timespan_period, $timespan_start and $timespan_end parameters initialize the attributes of the same name. cute and straightforward, we love to see it π
π«Ά OBJECT METHODS π«Ά
β version()
returns the version number of the report format used in the external representation of this report. the current version is 2.1. yes, specifically 2.1, write it down π
β generator([$generator)
returns the generator string that gets outputted in comments when the write_report() method is used. you can change that value by passing a new value through the $generator parameter. glow-up enabled π
β date( [ $new_date ] )
returns (and optionanly changes) the date in seconds since epoch on which this report was generated. epoch seconds, not your cute little calendar date, iykyk π°οΈ
β timespan_period( [ $new_period ] )
returns (and optionnally changes) the period of the report. the period can be 'hourly', 'daily', 'weekly', 'monthly' or 'yearly'. when the period is undef, it's an arbitrary period β yes, chaos is a valid option π
β timespan_start( [ $new_start ] )
returns (and optionnally changes) the start of the timespan covered by this report, in seconds since epoch. β³
β timespan_end( [ $new_end ] )
returns (and optionnally changes) the end of the timespan covered by this report, in seconds since epoch. and that's the whole timespan, slay π
β title( [$title] )
returns the report's title, if it has one.
if the $title is parameter is set, the report's title will be set to this new value. (yes, the original says "the $title is parameter" β we're not touching it, it's canon π«Ά)
β description( [$new_desc] )
returns the report description. heads up: this description is encoded in DocBook XML.
if the $description parameter is set, this method sets the description to this new value. if the $description parameter is undef, that description will be removed. gone, deleted, no cap π
β sections( )
returns the report's sections as an array. this will be an array of Lire::Report::Section objects. a whole little squad of them π§
β add_section( $section )
adds a section to this report. the $section parameter should be a Lire::Report::Section object. don't try to sneak anything else in there π
β subreport_by_id( $id )
returns the Lire::Report::Subreport object with $id. returns undef when there's no subreport with that ID. no subreport, no problem πββοΈ
β schemas()
returns an array reference containing all the schemas used by this report. array ref, not array β important detail bestie π₯
β write_report( [FH] );
writes the report in XML format on the FH filehandle, or STDOUT if omitted.
this method takes care of adding stuff like the XML header "<?xml version=[...]". it encodes the XML report in UTF-8, using Lire::I18N::set_fh_encoding(). encoding handled, you're welcome β¨
β delete( )
removes all circular references so that the object can be freed. literally freeing your fave from the circular reference situationship π¦
π SEE ALSO π
Lire::ReportParser::ReportBuilder(3pm)Lire::Report::Section(3pm)Lire::Report::Subreport(3pm)Lire::Report::Entry(3pm)Lire::Report::Group(3pm)Lire::ReportParser(3pm)
the whole friend group, go read them all ππ
πΈ AUTHOR πΈ
Francis J. Lacoste <flacoste@logreport.org> β thank you for your service π«‘π
π VERSION π
$Id: Report.pm,v 1.35 2006/07/23 13:16:29 vanbaal Exp $
π COPYRIGHT π
Copyright (C) 2002, 2004 Stichting LogReport Foundation
LogReport@LogReport.org
this file is part of Lire.
Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
this program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. see the GNU General Public License for more details.
you should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html.
ok that's the whole page bestie, every single flag, method, param and warning accounted for, nothing skipped, we ate and left no crumbs π β¨
and that's the tea π β this was Lire 2.1.1, dated 2025-09-28, page Report(3pm). mwah, go write some reports πππ¦
π¦ where this page comes from
- arch rolling: lire 2.1.1-8 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms