Program(3pm)

πŸ“¦ version 2.1.1, in arch rolling

πŸŽ€ NAME πŸŽ€

okay so this is Program(3pm) from LogReport's Lire Documentation, and the module is Lire::Program β€” literally Lire's programs common infrastructure. πŸ’…

✨ SYNOPSIS ✨

Any program:

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: ", $! );

🌸 DESCRIPTION 🌸

bestie, this module should be used by all Lire programs (at least the Perl ones :-).

It includes:

  1. Common behavior for good integration in the Lire suite. (Output of performance information and other stuff).
  2. Functions for portability.
  3. Logging functions

πŸ¦‹ 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's policy. 🫢

  1. Only messages in the proper logging format
I<superservice> I<service> I<lr_id> I<program> I<level> I<msg>

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.

See also lr_run(1).

  1. All programs should start by a "info" message which logs their arguments. This module takes care of this.
  2. All programs should end by printing "info" messages with performance statistics and the message 'ended'. Using this module takes care of this. At the end of your program the following will be output (stripped off the common information):
memory stats: vsize=10688K rss=9380K majflt=406
elapsed time in seconds real=9 user=8.72 system=0.06
stopped

The memory profiling information will only be output on platforms running the Linux kernel.

🧸 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.)

  • $PROG β€” The name of your program (that's the value of $0 without the directory path).
  • $LR_SUPERSERVICE β€” The superservice which you are processing, or "all" if this information isn't available.
  • $LR_SERVICE β€” The service which you are processing, or "all" if this information isn't specified.
  • $LR_ID β€” That's the job identifier. It should be shared by all commands in a Lire job. This is the value UNSET when none was specified.
  • $LR_TAG β€” That's the prefix to all log messages. Should correspond to
$LR_SUPERSERVICE $LR_SERVICE $LR_ID $PROG

πŸ”₯ LOGGING FUNCTIONS πŸ”₯

The logging functions are now part of the Lire::Logger module. Consult Lire::Logger(3pm) for more information. The old names are still exported from this module by using the :msg tag. ✨

πŸ’œ DLF CONVERTERS FUNCTIONS πŸ’œ

The DLF converter API is now defined in Lire::DlfConverter(3pm). The Lire::OldDlfAdapter(3pm) can be used to work with old-style DLF Converters.

🌈 SEE ALSO 🌈

Lire::DlfSchema(3pm), lr_run(1)

πŸ‘‘ AUTHOR πŸ‘‘

Francis J. Lacoste <flacoste@logreport.org>

⭐ VERSION ⭐

$Id: Program.pm,v 1.35 2006/07/23 13:16:29 vanbaal Exp $

Copyright (C) 2001 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.


okay that's the whole page, bestie β€” footer vibes: Lire 2.1.1, dated 2025-09-28, manual page Program(3pm). πŸ’…βœ¨

πŸ“¦ where this page comes from