package log; # $Id$ use diagnostics; use strict; use c; my ($LOG, $LOG2); sub l { if ($::testing) { print STDERR @_, "\n"; } elsif ($::isInstall) { if (!$LOG) { open $LOG, '>>', '/tmp/ddebug.log'; open $LOG2, '>', '/dev/tty3' if !$::local_install; select((select($LOG), $| = 1)[0]); select((select($LOG2), $| = 1)[0]) if !$::local_install; } print $LOG "* ", @_, "\n"; print $LOG2 "* ", @_, "\n" if $LOG2; } elsif ($::isStandalone) { #- openlog was done in standalone.pm c::syslog(c::LOG_WARNING(), join("", @_)); } else { print STDERR @_, "\n"; } } sub openLog { my ($file) = @_; open $LOG, "> $file"; select((select($LOG), $| = 1)[0]); } sub closeLog() { if ($LOG) { close $LOG; close $LOG2 if $LOG2; } elsif ($::isStandalone) { c::closelog(); } } sub explanations { if ($::isStandalone) { c::syslog(c::LOG_INFO()|c::LOG_LOCAL1(), "@_"); } else { l(@_); } } 1; dv2008.0 Mageia Installer and base platform for many utilitiesThierry Vignaud [tv]
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2005-09-12 15:08:07 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2005-09-12 15:08:07 +0000
commit322abdbb3dd9fe2eb907cd257bd3edd939df0e7d (patch)
tree3e35336b3d6fa1708388ddc8acf38d9f625deed4
parentad71250b57812af89e860341b401931b34d02900 (diff)
downloaddrakx-322abdbb3dd9fe2eb907cd257bd3edd939df0e7d.tar
drakx-322abdbb3dd9fe2eb907cd257bd3edd939df0e7d.tar.gz
drakx-322abdbb3dd9fe2eb907cd257bd3edd939df0e7d.tar.bz2
drakx-322abdbb3dd9fe2eb907cd257bd3edd939df0e7d.tar.xz
drakx-322abdbb3dd9fe2eb907cd257bd3edd939df0e7d.zip
sync with code
Diffstat