diff options
author | Nicolas Vigier <boklm@mageia.org> | 2012-07-05 17:23:10 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2012-07-05 17:23:10 +0000 |
commit | 37a325a1b59cfde1130994defa843afce425b095 (patch) | |
tree | 48e13e91b38b73da887979c9c4153393634c42d1 | |
parent | 54e3df7e419821569b21b22e5e289f1613754ae0 (diff) | |
download | iurt-37a325a1b59cfde1130994defa843afce425b095.tar iurt-37a325a1b59cfde1130994defa843afce425b095.tar.gz iurt-37a325a1b59cfde1130994defa843afce425b095.tar.bz2 iurt-37a325a1b59cfde1130994defa843afce425b095.tar.xz iurt-37a325a1b59cfde1130994defa843afce425b095.zip |
allow emi and ulri to log to a file instead of stderr by setting
EMI_LOG_FILE or ULRI_LOG_FILE environement variables
-rw-r--r-- | NEWS | 2 | ||||
-rwxr-xr-x | emi | 6 | ||||
-rwxr-xr-x | ulri | 5 |
3 files changed, 11 insertions, 2 deletions
@@ -1,4 +1,6 @@ 0.6.7 (unreleased) +- allow emi and ulri to log to a file instead of stderr by setting + EMI_LOG_FILE or ULRI_LOG_FILE environement variables - always show why iurt got killed when free space or log size is an issue - better error messages when running as root or w/o sudo - kill unused/untested features @@ -42,7 +42,11 @@ my %run; my $program_name = 'emi'; $run{program_name} = $program_name; -open(my $LOG, ">&STDERR"); +my $LOG; +if (!env{'EMI_LOG_FILE'} || !open($LOG, '>>', env{'EMI_LOG_FILE'})) { + open($LOG, ">&STDERR"); +} + plog_init($program_name, $LOG, 7, 1); my $HOME = $ENV{HOME}; @@ -49,7 +49,10 @@ my %run; my $program_name = 'ulri'; $run{program_name} = $program_name; -open(my $LOG, ">&STDERR"); +my $LOG; +if (!$ENV{'ULRI_LOG_FILE'} || !open($LOG, '>>', $ENV{'ULRI_LOG_FILE'})) { + open(my $LOG, ">&STDERR"); +} plog_init($program_name, $LOG, 7, 1); |