.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "Program 3pm" .TH Program 3pm 2025-09-28 "Lire 2.1.1" "LogReport's Lire Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Lire::Program \- Lire\*(Aqs programs common infrastructure. .SH SYNOPSIS .IX Header "SYNOPSIS" Any program: .PP .Vb 1 \& use Lire::Program qw/ :msg /; \& \& lr_info( "doing stuff " ); \& lr_debug( "debugging information" ); \& lr_warn( "encountered unexpected value: ", $value ); \& open( CFGFILE, "my.conf" ) or lr_err( "open error: ", $! ); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This module should be used by all Lire programs (at least the Perl ones :\-). .PP It includes: .IP 1. 4 Common behavior for good integration in the Lire suite. (Output of performance information and other stuff). .IP 2. 4 Functions for portability. .IP 3. 4 Logging functions .SH "COMMON BEHAVIOR FOR LIRE PROGRAMS" .IX Header "COMMON BEHAVIOR FOR LIRE PROGRAMS" When you use the Lire::Program module, you make sure that your program will behave correctly in the Lire tool chain. This module will install BEGIN and END blocks to comply with Lire\*(Aqs policy. .IP 1. 4 Only messages in the proper logging format .Sp .Vb 1 \& I I I I I I .Ve .Sp should be output. This module will install a _\|_WARN_\|_ signal handler that makes sure that all modules that use warn to output messages are rewritten in the proper format. .Sp See also \fBlr_run\fR\|(1). .IP 2. 4 All programs should start by a \f(CW\*(C`info\*(C'\fR message which logs their arguments. This module takes care of this. .IP 3. 4 All programs should end by printing \f(CW\*(C`info\*(C'\fR messages with performance statistics and the message \*(Aqended\*(Aq. Using this module takes care of this. At the end of your program the following will be output (stripped off the common information): .Sp .Vb 3 \& memory stats: vsize=10688K rss=9380K majflt=406 \& elapsed time in seconds real=9 user=8.72 system=0.06 \& stopped .Ve .Sp The memory profiling information will only be output on platforms running the Linux kernel. .SS "COMMON VARIABLES" .IX Subsection "COMMON VARIABLES" As a convenience, you can import in your namespace using the :env tag some variables common to all Lire programs. (Note that you can also use those variables without importing them by prefixing the variables with the Lire::Program:: namespace.) .ie n .IP $PROG 4 .el .IP \f(CW$PROG\fR 4 .IX Item "$PROG" The name of your program (that\*(Aqs the value of \f(CW$0\fR without the directory path). .ie n .IP $LR_SUPERSERVICE 4 .el .IP \f(CW$LR_SUPERSERVICE\fR 4 .IX Item "$LR_SUPERSERVICE" The superservice which you are processing, or \f(CW\*(C`all\*(C'\fR if this information isn\*(Aqt available. .ie n .IP $LR_SERVICE 4 .el .IP \f(CW$LR_SERVICE\fR 4 .IX Item "$LR_SERVICE" The service which you are processing, or \f(CW\*(C`all\*(C'\fR if this information isn\*(Aqt specified. .ie n .IP $LR_ID 4 .el .IP \f(CW$LR_ID\fR 4 .IX Item "$LR_ID" That\*(Aqs the job identifier. It should be shared by all commands in a Lire job. This is the value UNSET when none was specified. .ie n .IP $LR_TAG 4 .el .IP \f(CW$LR_TAG\fR 4 .IX Item "$LR_TAG" That\*(Aqs the prefix to all log messages. Should correspond to .Sp .Vb 1 \& $LR_SUPERSERVICE $LR_SERVICE $LR_ID $PROG .Ve .SH "LOGGING FUNCTIONS" .IX Header "LOGGING FUNCTIONS" The logging functions are now part of the Lire::Logger module. Consult \&\fBLire::Logger\fR\|(3pm) for more information. The old names are still exported from this module by using the \*(Aq:msg\*(Aq tag. .SH "DLF CONVERTERS FUNCTIONS" .IX Header "DLF CONVERTERS FUNCTIONS" The DLF converter API is now defined in \fBLire::DlfConverter\fR\|(3pm). The \&\fBLire::OldDlfAdapter\fR\|(3pm) can be used to work with old\-style DLF Converters. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBLire::DlfSchema\fR\|(3pm), \fBlr_run\fR\|(1) .SH AUTHOR .IX Header "AUTHOR" .Vb 1 \& Francis J. Lacoste .Ve .SH VERSION .IX Header "VERSION" \&\f(CW$Id:\fR Program.pm,v 1.35 2006/07/23 13:16:29 vanbaal Exp $ .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright (C) 2001 Stichting LogReport Foundation LogReport@LogReport.org .PP This file is part of Lire. .PP 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. .PP 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. .PP 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.