aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Iurt
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-03-26 18:20:52 +0000
committerThierry Vignaud <tv@mageia.org>2012-03-26 18:20:52 +0000
commit469a9dad368a25ede43f61b760ff7c8532aff712 (patch)
tree9b15ed535e5adb6be56230d6d11d7dee101ab799 /lib/Iurt
parent681eca4d4baff8969b2f1983a463533765589e95 (diff)
downloadiurt-469a9dad368a25ede43f61b760ff7c8532aff712.tar
iurt-469a9dad368a25ede43f61b760ff7c8532aff712.tar.gz
iurt-469a9dad368a25ede43f61b760ff7c8532aff712.tar.bz2
iurt-469a9dad368a25ede43f61b760ff7c8532aff712.tar.xz
iurt-469a9dad368a25ede43f61b760ff7c8532aff712.zip
fix variables after previous commit
Diffstat (limited to 'lib/Iurt')
-rw-r--r--lib/Iurt/Util.pm16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Iurt/Util.pm b/lib/Iurt/Util.pm
index b86c898..fa6f37f 100644
--- a/lib/Iurt/Util.pm
+++ b/lib/Iurt/Util.pm
@@ -15,7 +15,7 @@ our @EXPORT = qw(
sput
);
-my ($plog_name, $plog_file, $plog_level, $plog_color);
+my ($plog_name, $plog_file, $o_plog_level, $o_plog_color);
=head2 LOG HELPERS
@@ -68,16 +68,16 @@ my %plog_level = (
sub plog_init {
($plog_name, $plog_file, $o_plog_level, $o_plog_color) = @_;
- $plog_level ||= 9999;
- $plog_color ||= 0;
+ $o_plog_level ||= 9999;
+ $o_plog_color ||= 0;
- $plog_level = 9999 if $ENV{PLOG_DEBUG};
+ $o_plog_level = 9999 if $ENV{PLOG_DEBUG};
- $plog_color = 0 unless -t fileno $plog_file;
+ $o_plog_color = 0 unless -t fileno $plog_file;
$_ .= "[$plog_name] " foreach @plog_prefix;
- if ($plog_color) {
+ if ($o_plog_color) {
$plog_prefix[1] .= "$plog_ctr{bold}$plog_ctr{red}";
$plog_prefix[2] .= "$plog_ctr{bold}$plog_ctr{yellow}";
$plog_prefix[3] .= $plog_ctr{bold};
@@ -106,9 +106,9 @@ level set with plog_init().
sub plog {
my $level = $#_ ? shift : 'INFO';
$level = $plog_level{$level};
- my ($p, $e) = ($plog_prefix[$level], ($plog_color ? $plog_ctr{normal} : ""));
+ my ($p, $e) = ($plog_prefix[$level], ($o_plog_color ? $plog_ctr{normal} : ""));
- if ($plog_level >= $level) {
+ if ($o_plog_level >= $level) {
flock($plog_file, LOCK_EX);
seek($plog_file, 0, SEEK_END);
print $plog_file "$p@_$e\n";