aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rwxr-xr-xemi6
-rwxr-xr-xulri5
3 files changed, 11 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index ad140ae..09d0ffe 100644
--- a/NEWS
+++ b/NEWS
@@ -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
diff --git a/emi b/emi
index 179ca07..716330d 100755
--- a/emi
+++ b/emi
@@ -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};
diff --git a/ulri b/ulri
index 011e2c4..06b325d 100755
--- a/ulri
+++ b/ulri
@@ -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);