Quizzer::Log - debconf log module


Quizzer documentation Contained in the Quizzer distribution.

Index


Code Index:

NAME

Top

Quizzer::Log -- debconf log module

DESCRIPTION

Top

This is a log module for debconf. It can output messages at varying priorities.

This module uses Exporter.

METHODS

Top

debug

Outputs an infomational message, if DEBCONF_DEBUG is set in the environment to a value >= the first parameter.

warn

Outputs a warning message. This overrides the builtin perl warn() command.

AUTHOR

Top

Joey Hess <joey@kitenet.net>


Quizzer documentation Contained in the Quizzer distribution.
#!/usr/bin/perl

package Quizzer::Log;
use Exporter;
use strict;
use vars qw(@ISA @EXPORT_OK %EXPORT_TAGS);

my $VERSION='0.01';

@ISA = qw(Exporter);
@EXPORT_OK=qw(debug warn);
# Import :all to get everything.
%EXPORT_TAGS = (all => [@EXPORT_OK]);

sub debug {
	my $priority=shift;
	if (exists $ENV{DEBCONF_DEBUG} && $priority <= int($ENV{DEBCONF_DEBUG})) {
		print STDERR "debconf: ".join(" ", @_)."\n";
	}
}

sub warn {
	print STDERR "debconf: ".join(" ", @_)."\n";
}

1