From 2512f54e33438e35057e01a7f16ffcc815893b9c Mon Sep 17 00:00:00 2001 From: lissav Date: Mon, 26 Nov 2007 18:41:46 +0000 Subject: [PATCH] Remove special checks for DSH_API calls. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@74 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT-2.0/xCAT/MsgUtils.pm | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/perl-xCAT-2.0/xCAT/MsgUtils.pm b/perl-xCAT-2.0/xCAT/MsgUtils.pm index 7a0ac469c..d51d3bea1 100644 --- a/perl-xCAT-2.0/xCAT/MsgUtils.pm +++ b/perl-xCAT-2.0/xCAT/MsgUtils.pm @@ -125,9 +125,9 @@ sub message # Process the arguments shift; # get rid of the class name - my $sevcode = shift; - my $msg = shift; - my $call_back = shift; # optional + my $sevcode = shift; + my $msg = shift; + my $call_back = shift; # optional # Parse the severity code my $i = 1; @@ -135,10 +135,10 @@ sub message my $sev = substr($sevcode, 0, 1); # should be I, E, V, T - if ($sev eq 'T') # do not put timestamp + if ($sev eq 'T') # do not put timestamp { - $notimestamp = 1; # no timestamp - $i = 2; # logically shift everything by 1 char + $notimestamp = 1; # no timestamp + $i = 2; # logically shift everything by 1 char $sev = substr($sevcode, 1, 1); # now should be either I,E,V } @@ -169,18 +169,14 @@ sub message # turned on and there is no logging. if (($sev eq 'V' && $::VERBOSE) || ($sev ne 'V')) { - if ($::DSH_API) - { - $::DSH_API_MESSAGE = $::DSH_API_MESSAGE . $msg; + if ($call_back) + { # callback routine provided + $call_back->($msg); } else { - if ($call_back) { # callback routine provided - $call_back->($msg); - } else { - print $stdouterrf $msg; # print the message - - } + print $stdouterrf $msg; # print the message + } } return 0; @@ -269,7 +265,7 @@ sub start_logging # create the log directory if it's not already there if (!-d $::XCATLOG) { - mkdir($::XCATLOG, 0755); + mkdir($::XCATLOG, 0755); } # open the log file