提交 d1e2f22a 编写于 作者: S Steven Rostedt 提交者: Steven Rostedt

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: NSteven Rostedt <rostedt@goodmis.org>
上级 9386c6ab
...@@ -230,7 +230,7 @@ sub read_config { ...@@ -230,7 +230,7 @@ sub read_config {
} }
} }
sub logit { sub _logit {
if (defined($opt{"LOG_FILE"})) { if (defined($opt{"LOG_FILE"})) {
open(OUT, ">> $opt{LOG_FILE}") or die "Can't write to $opt{LOG_FILE}"; open(OUT, ">> $opt{LOG_FILE}") or die "Can't write to $opt{LOG_FILE}";
print OUT @_; print OUT @_;
...@@ -238,9 +238,17 @@ sub logit { ...@@ -238,9 +238,17 @@ sub logit {
} }
} }
sub logit {
if (defined($opt{"LOG_FILE"})) {
_logit @_;
} else {
print @_;
}
}
sub doprint { sub doprint {
print @_; print @_;
logit @_; _logit @_;
} }
sub run_command; sub run_command;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册