summaryrefslogtreecommitdiffstats
path: root/perl-install/log.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-12-09 00:52:32 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-12-09 00:52:32 +0000
commitd59b27d5fcc346d96072ed0edb88cda0223be084 (patch)
treef605bc19591d3cf23d372a5ace6c70fbe367a620 /perl-install/log.pm
parent1934b3123c81c2ccb425626aa61ed29e38780ddf (diff)
downloaddrakx-backup-do-not-use-d59b27d5fcc346d96072ed0edb88cda0223be084.tar
drakx-backup-do-not-use-d59b27d5fcc346d96072ed0edb88cda0223be084.tar.gz
drakx-backup-do-not-use-d59b27d5fcc346d96072ed0edb88cda0223be084.tar.bz2
drakx-backup-do-not-use-d59b27d5fcc346d96072ed0edb88cda0223be084.tar.xz
drakx-backup-do-not-use-d59b27d5fcc346d96072ed0edb88cda0223be084.zip
no_comment
Diffstat (limited to 'perl-install/log.pm')
-rw-r--r--perl-install/log.pm32
1 files changed, 21 insertions, 11 deletions
diff --git a/perl-install/log.pm b/perl-install/log.pm
index 2e1da1a77..853cabc8c 100644
--- a/perl-install/log.pm
+++ b/perl-install/log.pm
@@ -2,6 +2,7 @@ package log;
use diagnostics;
use strict;
+use c;
#-#####################################################################################
@@ -14,33 +15,42 @@ my $logDebugMessages = 0;
#-######################################################################################
#- Functions
#-######################################################################################
-sub fd() { fileno LOG }
sub F() { *LOG }
sub l {
$logOpen or openLog();
- print LOG "* ", @_, "\n";
- print LOG2 "* ", @_, "\n";
+ if ($::isStandalone) {
+ c::syslog(join "", @_);
+ } else {
+ print LOG "* ", @_, "\n";
+ print LOG2 "* ", @_, "\n";
+ }
}
sub ld { $logDebugMessages and &l }
sub w { &l }
sub openLog(;$) {
if ($::isStandalone) {
- open LOG, ">&STDERR";
- } elsif ($_[0]) { #- useLocal
- open LOG, "> $_[0]";# or die "no log possible :(";
+ c::openlog("DrakX");
} else {
- open LOG, "> /dev/tty3" or open LOG, ">> /tmp/install.log";# or die "no log possible :(";
+ if ($_[0]) { #- useLocal
+ open LOG, "> $_[0]";# or die "no log possible :(";
+ } else {
+ open LOG, "> /dev/tty3" or open LOG, ">> /tmp/install.log";# or die "no log possible :(";
+ }
+ open LOG2, ">> /tmp/ddebug.log";# or die "no log possible :(";
+ select((select(LOG), $| = 1)[0]);
+ select((select(LOG2), $| = 1)[0]);
}
- open LOG2, ">> /tmp/ddebug.log";# or die "no log possible :(";
- select((select(LOG), $| = 1)[0]);
- select((select(LOG2), $| = 1)[0]);
exists $ENV{DEBUG} and $logDebugMessages = 1;
$logOpen = 1;
}
-sub closeLog() { close LOG; close LOG2; }
+sub closeLog() {
+ if ($::isStandalone) {
+ c::closelog();
+ } else { close LOG; close LOG2; }
+}
#-######################################################################################
#- Wonderful perl :(