Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1e2f22a authored by Steven Rostedt's avatar Steven Rostedt Committed by Steven Rostedt
Browse files

ktest: Write to stdout if no log file is given



If no LOG_FILE option is set, then write what would be logged to
that file to standard output.

Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 9386c6ab
Loading
Loading
Loading
Loading

tools/testing/ktest/ktest.pl

100644 → 100755
+10 −2
Original line number Diff line number Diff line
@@ -230,7 +230,7 @@ sub read_config {
    }
}

sub logit {
sub _logit {
    if (defined($opt{"LOG_FILE"})) {
	open(OUT, ">> $opt{LOG_FILE}") or die "Can't write to $opt{LOG_FILE}";
	print OUT @_;
@@ -238,9 +238,17 @@ sub logit {
    }
}

sub logit {
    if (defined($opt{"LOG_FILE"})) {
	_logit @_;
    } else {
	print @_;
    }
}

sub doprint {
    print @_;
    logit @_;
    _logit @_;
}

sub run_command;