Add function verbose_message, not sure who wrote it.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@13219 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
yinle 2012-07-01 03:25:57 +00:00
parent a150ad3ee2
commit d373e3f456

View File

@ -710,5 +710,24 @@ sub backup_logfile
return $::OK;
}
sub verbose_message
{
shift;
my $req = shift;
my $data = shift;
if (!defined($req->{verbose})) {
return;
}
my ($sec,$min,$hour,$mday,$mon,$yr,$wday,$yday,$dst) = localtime(time);
my $time = sprintf "%04d%02d%02d.%02d:%02d:%02d", $yr+1900,$mon+1,$mday,$hour,$min,$sec;
$data = "$time ($$) ".$data;
if (defined($req->{callback})) {
my %rsp;
$rsp{data} = [$data];
xCAT::MsgUtils->message("I", \%rsp, $req->{callback});
} else {
xCAT::MsgUtils->message("I", $data);
}
}
1;