Commit a7672c15 authored by Stefan Tauner's avatar Stefan Tauner
Browse files

Further reduce verbosity by degrading messages

parent 4681291b
......@@ -92,7 +92,7 @@ sub init {
$logger->warn("Could not write UART settings for \"$portname\".");
return undef;
}
$logger->info("Using serial port $portname with baud rate $baudrate.");
$logger->debug("Using serial port $portname with baud rate $baudrate.");
my %hash;
$hash{'port'} = $port;
......@@ -374,7 +374,7 @@ sub sanitize_config {
if (!defined($msg_type) || $msg_type ne 'CONF_DONE') {
$logger->warn(sprintf("Received message is not a valid CONF_DONE message (but %s).", defined($msg_type) ? $msg_type : "invalid"));
if (($underrun_try_cnt-- > 0) && (!defined($msg_type) || $msg_type eq 'UNDERRUN')) {
$logger->warn(sprintf("Retrying to fetch CONF_DONE after reception of UNDERRUN."));
$logger->info(sprintf("Retrying to fetch CONF_DONE after reception of UNDERRUN."));
$underrun_occurred++;
goto retry_underrun;
}
......@@ -382,7 +382,7 @@ sub sanitize_config {
return {msg_type => $msg_type, fault_detect => \%fd, error => \%err};
}
if ($err{'ANY'} != 0) {
$logger->error("Received message indicated errors.");
$logger->debug("Received message indicated errors.");
return {msg_type => $msg_type, fault_detect => \%fd, error => \%err};
}
......
......@@ -640,38 +640,26 @@ sub _sanitize_design {
my $logger = get_logger("");
my ($consts_ref, $phase) = @_;
if (ref($consts_ref) ne 'HASH') {
my $msg = "Parameter is not a reference to a hash (containing design constants).";
$logger->error($msg);
return $msg;
return "Parameter is not a reference to a hash (containing design constants).";
}
# check for sane values
$consts_ref = _validate_hashmap(DESIGNMAP, $consts_ref, $phase);
if (!ref($consts_ref)) {
my $msg = "Could not validate Design Constants.";
$logger->error($msg);
return "$msg $consts_ref";
return "Could not validate Design Constants." . (defined($consts_ref) ? " $consts_ref" : "");
}
if (($consts_ref->{'FIU_CFG_BITS'} <= 0)) {
my $msg = "FIU_CFG_BITS is <= 0.";
$logger->error($msg);
return $msg;
return "FIU_CFG_BITS is <= 0.";
}
if (($consts_ref->{'TIMER_WIDTH'} <= 0) || ($consts_ref->{'TIMER_WIDTH'} > 16)) {
my $msg = "TIMER_WIDTH is invalid ($consts_ref->{'TIMER_WIDTH'}).";
$logger->error($msg);
return $msg;
return "TIMER_WIDTH is invalid ($consts_ref->{'TIMER_WIDTH'}).";
}
if (defined($consts_ref->{'ID'}) && ($consts_ref->{ID} < 0 || $consts_ref->{ID} > (2**16 - 1))) {
my $msg = "ID is invalid ($consts_ref->{ID}).";
$logger->error($msg);
return $msg;
return sprintf("ID is invalid (0x%04X).", $consts_ref->{ID});
}
if (($consts_ref->{'BAUDRATE'} <= 0)) {
my $msg = "BAUDRATE missing is <= 0.";
$logger->error($msg);
return $msg;
return "BAUDRATE missing is <= 0.";
}
return $consts_ref;
......
......@@ -334,7 +334,7 @@ sub get_last_test {
my $self = shift;
my $lt;
if (!defined $self->{'last_test'}) {
my $msg = "No data available.";
my $msg = "Could not determine last test case.";
$logger->error($msg);
my $d = $self->{'mw'}->FIJIModalDialog(-image => Tk::FIJIUtils::error_image($self->{'mw'}),
-wraplength => "200",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment