errors e warnings separati - errors rossi

This commit is contained in:
2021-01-06 18:09:51 +01:00
parent ec57aaf3d5
commit fe6312a615

View File

@@ -54,7 +54,11 @@ my $D2W_fcheck = 0;
my $FtpToCustomerCmd = 'SendFtpElabData.pl';
my ( $scriptname, $scriptpath );
my $MatlabErrorFilename = "/tmp/";
my $matlabOutputError = '';
my @matlabOutputErrorArray;
my @errors;
my @warnings;
my $MatlabErrors = '';
my $MatlabWarnings = '';
sub getTimeStamp
{ # parm [ts] => timestamp for filename; log => timestamp for log
@@ -133,12 +137,16 @@ sub matlabCalc {
or warn print getTimeStamp("log")
. " - pid $$ >> Cannot open Matlab output error file: ${MatlabErrorFilename}\n";
{
local $/;
$matlabOutputError = <$fh>;
chomp( @matlabOutputErrorArray = <$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;
if ( $exit_value == 124 ) {
print getTimeStamp("log")
. " - pid $$ >> system @args excessive duration: killed after $matlab_timeout seconds\n";
@@ -328,9 +336,14 @@ sub makeEmailMsg {
<h4 style="margin: 5px;">$matlab_error</h4>
</td>
</tr>
<tr>
<td style="padding: 20px; padding-bottom: 0px; color: red">
$MatlabErrors
</td>
</tr>
<tr>
<td style="padding: 20px;">
$matlabOutputError
$MatlabWarnings
</td>
</tr>
</table>