errors e warnings separati - errors rossi
This commit is contained in:
@@ -54,7 +54,11 @@ my $D2W_fcheck = 0;
|
|||||||
my $FtpToCustomerCmd = 'SendFtpElabData.pl';
|
my $FtpToCustomerCmd = 'SendFtpElabData.pl';
|
||||||
my ( $scriptname, $scriptpath );
|
my ( $scriptname, $scriptpath );
|
||||||
my $MatlabErrorFilename = "/tmp/";
|
my $MatlabErrorFilename = "/tmp/";
|
||||||
my $matlabOutputError = '';
|
my @matlabOutputErrorArray;
|
||||||
|
my @errors;
|
||||||
|
my @warnings;
|
||||||
|
my $MatlabErrors = '';
|
||||||
|
my $MatlabWarnings = '';
|
||||||
|
|
||||||
sub getTimeStamp
|
sub getTimeStamp
|
||||||
{ # parm [ts] => timestamp for filename; log => timestamp for log
|
{ # parm [ts] => timestamp for filename; log => timestamp for log
|
||||||
@@ -133,12 +137,16 @@ sub matlabCalc {
|
|||||||
or warn print getTimeStamp("log")
|
or warn print getTimeStamp("log")
|
||||||
. " - pid $$ >> Cannot open Matlab output error file: ${MatlabErrorFilename}\n";
|
. " - pid $$ >> Cannot open Matlab output error file: ${MatlabErrorFilename}\n";
|
||||||
{
|
{
|
||||||
local $/;
|
chomp( @matlabOutputErrorArray = <$fh> );
|
||||||
$matlabOutputError = <$fh>;
|
|
||||||
}
|
}
|
||||||
close($fh);
|
close($fh);
|
||||||
$matlabOutputError =~ s/\n/<br>/g;
|
@matlabOutputErrorArray = grep( /\S/, @matlabOutputErrorArray );
|
||||||
|
@errors = grep( /^Error/, @matlabOutputErrorArray );
|
||||||
|
@warnings = grep( !/^Error/, @matlabOutputErrorArray );
|
||||||
|
$MatlabErrors = join( "<br>", @errors );
|
||||||
|
$MatlabWarnings = join( "<br>", @warnings );
|
||||||
my $exit_value = $? >> 8;
|
my $exit_value = $? >> 8;
|
||||||
|
|
||||||
if ( $exit_value == 124 ) {
|
if ( $exit_value == 124 ) {
|
||||||
print getTimeStamp("log")
|
print getTimeStamp("log")
|
||||||
. " - pid $$ >> system @args excessive duration: killed after $matlab_timeout seconds\n";
|
. " - pid $$ >> system @args excessive duration: killed after $matlab_timeout seconds\n";
|
||||||
@@ -328,9 +336,14 @@ sub makeEmailMsg {
|
|||||||
<h4 style="margin: 5px;">$matlab_error</h4>
|
<h4 style="margin: 5px;">$matlab_error</h4>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="padding: 20px; padding-bottom: 0px; color: red">
|
||||||
|
$MatlabErrors
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="padding: 20px;">
|
<td style="padding: 20px;">
|
||||||
$matlabOutputError
|
$MatlabWarnings
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
Reference in New Issue
Block a user